Documentation ¶
Index ¶
- func AccAddrPrefixConvert(srcPrefx, srcAccAddrStr, dstPrefix string) (dstAccAddrStr string, err error)
- func ConvertToDelegatorResponse(delegator stakingtypes.Delegator, undelegation stakingtypes.UndelegationInfo) stakingcli.DelegatorResponse
- func CreateAccount(name, passWd string) (info keys.Info, mnemo string, err error)
- func CreateAccountWithMnemo(mnemonic, name, passWd string) (info keys.Info, mnemo string, err error)
- func CreateAccountWithPrivateKey(privateKey, name, passWd string) (info keys.Info, err error)
- func ErrClientQuery(errMsg string) error
- func ErrFilterDataFromBaseResponse(kind, errMsg string) error
- func ErrFilterDataFromListResponse(kind, errMsg string) error
- func ErrMarshalJSON(errMsg string) error
- func ErrUnmarshalJSON(errMsg string) error
- func EthAddress(ethAddrStr string) ethcmn.Address
- func EthAddresses(ethAddrsStr []string) []ethcmn.Address
- func FormatKeyToHash(keyStr string) string
- func GenerateEthPrivateKeyFromMnemo(mnemonic string) (privKey ethsecp256k1.PrivKey, err error)
- func GenerateMnemonic() (mnemo string, err error)
- func GeneratePrivateKeyFromMnemo(mnemonic string) (privKey string, err error)
- func GetDataFromBaseResponse(bytes []byte, ptr interface{}) error
- func IsValidHexAdress(address string) bool
- func ParseTransfersStr(str string) ([]types.TransferUnit, error)
- func ParseValAddresses(valAddrsStr []string) ([]sdk.ValAddress, error)
- func ToCosmosAddress(addrStr string) (accAddr sdk.AccAddress, err error)
- func ToHexAddress(addrStr string) (ethAddr ethcmn.Address, err error)
- func Uint256(i *big.Int) *big.Int
- func UnmarshalListResponse(bz []byte, ptr interface{}) error
- func ValAddrPrefixConvert(srcPrefx, srcValAddrStr, dstPrefix string) (dstValAddrStr string, err error)
- type PayloadBuilder
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AccAddrPrefixConvert ¶
func AccAddrPrefixConvert(srcPrefx, srcAccAddrStr, dstPrefix string) (dstAccAddrStr string, err error)
AccAddrPrefixConvert converts the account address between two different prefixes
func ConvertToDelegatorResponse ¶
func ConvertToDelegatorResponse(delegator stakingtypes.Delegator, undelegation stakingtypes.UndelegationInfo) stakingcli.DelegatorResponse
ConvertToDelegatorResponse builds DelegatorResponse with the info of Delegator and UndelegationInfo
func CreateAccount ¶
CreateAccount creates a random key info with the given name and password
func CreateAccountWithMnemo ¶
func CreateAccountWithMnemo(mnemonic, name, passWd string) (info keys.Info, mnemo string, err error)
CreateAccountWithMnemo creates the key info with the given mnemonic, name and password
func CreateAccountWithPrivateKey ¶
CreateAccountWithPrivateKey creates the key info with the given privateKey string, name and password
func ErrClientQuery ¶
ErrClientQuery returns an error when client failed in query
func ErrFilterDataFromBaseResponse ¶
ErrFilterDataFromBaseResponse returns an error when it failed to filter data from backend base response
func ErrFilterDataFromListResponse ¶
ErrFilterDataFromListResponse returns an error when it failed to filter data from backend list response
func ErrMarshalJSON ¶
ErrMarshalJSON returns an error when it failed in marshaling JSON
func ErrUnmarshalJSON ¶
ErrUnmarshalJSON returns an error when it failed in unmarshaling JSON
func EthAddress ¶
EthAddress gets the available arg for payload Build
func EthAddresses ¶
EthAddresses gets the available arg for payload Build
func FormatKeyToHash ¶
FormatKeyToHash converts the key string to hash
func GenerateEthPrivateKeyFromMnemo ¶
func GenerateEthPrivateKeyFromMnemo(mnemonic string) (privKey ethsecp256k1.PrivKey, err error)
func GenerateMnemonic ¶
GenerateMnemonic creates a random mnemonic
func GeneratePrivateKeyFromMnemo ¶
GeneratePrivateKeyFromMnemo converts mnemonic to private key
func GetDataFromBaseResponse ¶
GetDataFromBaseResponse gets the detail data from the base response bytes
func ParseTransfersStr ¶
func ParseTransfersStr(str string) ([]types.TransferUnit, error)
ParseTransfersStr parses the whole multi-send info string into TransferUnit Example: `addr1 1okt
addr2 2okt`
func ParseValAddresses ¶
func ParseValAddresses(valAddrsStr []string) ([]sdk.ValAddress, error)
ParseValAddresses parses validator address string to types.ValAddress
func ToCosmosAddress ¶
func ToCosmosAddress(addrStr string) (accAddr sdk.AccAddress, err error)
ToCosmosAddress converts string address of cosmos and ethereum style to cosmos address
func ToHexAddress ¶
ToHexAddress converts string address of cosmos and ethereum style to ethereum address
func UnmarshalListResponse ¶
UnmarshalListResponse unmarshals the list response from data bytes
func ValAddrPrefixConvert ¶
func ValAddrPrefixConvert(srcPrefx, srcValAddrStr, dstPrefix string) (dstValAddrStr string, err error)
ValAddrPrefixConvert converts the validator address between two different prefixes
Types ¶
type PayloadBuilder ¶
type PayloadBuilder struct {
// contains filtered or unexported fields
}
PayloadBuilder - structure of a useful tool to build payload
func NewPayloadBuilder ¶
func NewPayloadBuilder(binStr, abiJSON string) (payloadBuilder PayloadBuilder, err error)
NewPayloadBuilder creates a new instance of PayloadBuilder