Documentation ¶
Index ¶
- Variables
- func CheckEthHashStatus(hash string) int
- func ConvertToToken(value int64) float64
- func ConvertToValue(token float64) int64
- func ConvertZcnTokenToETH(token float64) (float64, error)
- func CreateWallet(statusCb models.WalletCallback) error
- func CreateWalletFromEthMnemonic(mnemonic, password string, statusCb models.WalletCallback) error
- func EthToTokens(tokens float64) int64
- func GEthToTokens(gwei float64) int64
- func GTokensToEth(tokens int64) float64
- func GetBalance(cb models.GetBalanceCallback) error
- func GetEthBalance(ethAddr string, cb models.GetBalanceCallback) error
- func GetVersion() string
- func GetWalletAddrFromEthMnemonic(mnemonic string) (string, error)
- func Init(chainConfigJSON string) error
- func IsMnemonicValid(mnemonic string) bool
- func IsValidEthAddress(ethAddr string) (bool, error)
- func RecoverWallet(mnemonic string, statusCb models.WalletCallback) error
- func SetLogLevel(lvl int)
- func SetWalletInfo(w string, splitKeyWallet bool) error
- func SuggestEthGasPrice() (int64, error)
- func TokensToEth(tokens int64) float64
- func TransferEthTokens(fromPrivKey string, amountTokens, gasPrice int64) (string, error)
Constants ¶
This section is empty.
Variables ¶
var GetEthClient = func() (*ethclient.Client, error) { if len(zcncore.GetConfig().GetChain().EthNode) == 0 { return nil, fmt.Errorf("eth node SDK not initialized") } zcncore.Logger.Info("requesting from ", zcncore.GetConfig().GetChain().EthNode) client, err := ethclient.Dial(zcncore.GetConfig().GetChain().EthNode) if err != nil { return nil, err } return client, nil }
Functions ¶
func CheckEthHashStatus ¶
CheckEthHashStatus - checking the status of ETH transaction possible values 0 or 1
func ConvertToToken ¶
ConvertToToken converts the value to ZCN tokens
func ConvertToValue ¶
ConvertToValue converts ZCN tokens to value
func ConvertZcnTokenToETH ¶
ConvertZcnTokenToETH - converting Zcn tokens to Eth
func CreateWallet ¶
func CreateWallet(statusCb models.WalletCallback) error
CreateWallet creates the wallet for to configure signature scheme. It also registers the wallet again to block chain.
func CreateWalletFromEthMnemonic ¶
func CreateWalletFromEthMnemonic(mnemonic, password string, statusCb models.WalletCallback) error
CreateWalletFromEthMnemonic - creating new wallet from Eth mnemonics
func EthToTokens ¶
TokensToEth - converting eth tokens to wei
func GEthToTokens ¶
func GTokensToEth ¶
func GetBalance ¶
func GetBalance(cb models.GetBalanceCallback) error
GetBalance retreives wallet balance from sharders
func GetEthBalance ¶
func GetEthBalance(ethAddr string, cb models.GetBalanceCallback) error
GetEthBalance - getting back balance for ETH wallet
func GetWalletAddrFromEthMnemonic ¶
GetWalletAddrFromEthMnemonic - wallet ETH address from mnemoninnc
func IsMnemonicValid ¶
IsMnemonicValid is an utility function to check the mnemonic valid
func IsValidEthAddress ¶
IsValidEthAddress - multiple checks for valid ETH address
func RecoverWallet ¶
func RecoverWallet(mnemonic string, statusCb models.WalletCallback) error
RecoverWallet recovers the previously generated wallet using the mnemonic. It also registers the wallet again to block chain.
func SetLogLevel ¶
func SetLogLevel(lvl int)
SetLogLevel set the log level. lvl - 0 disabled; higher number (upto 4) more verbosity
func SetWalletInfo ¶
SetWalletInfo should be set before any transaction or client specific APIs splitKeyWallet parameter is valid only if SignatureScheme is "BLS0Chain"
func SuggestEthGasPrice ¶
SuggestEthGasPrice - return back suggested price for gas
func TokensToEth ¶
TokensToEth - converting wei to eth tokens
Types ¶
This section is empty.