Documentation ¶
Index ¶
- func GenerateNewMnemonic() (string, error)
- func GetAddressFromPrivateKey(privateKeyBytes []byte) (string, error)
- func GetPrivateKeyFromMnemonic(mnemonic string, account, addressIndex uint8) []byte
- func LoadPrivateKeyFromJsonFile(filename string, password string) ([]byte, error)
- func LoadPrivateKeyFromPemFile(filename string) ([]byte, error)
- func SavePrivateKeyToJsonFile(privateKey []byte, password string, filename string) error
- func SavePrivateKeyToPemFile(privateKey []byte, filename string) error
- func SignTransaction(tx *data.Transaction, privateKey []byte) error
- func SignTransactionHash(tx *data.Transaction, privateKey []byte) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GenerateNewMnemonic ¶
GenerateNewMnemonic generates a new set of 24 words to be used as seed phrase
func GetAddressFromPrivateKey ¶
GetAddressFromPrivateKey generates the bech32 address from a private key
func GetPrivateKeyFromMnemonic ¶
GetPrivateKeyFromMnemonic generates a private key based on mnemonic, account and address index
func LoadPrivateKeyFromJsonFile ¶
LoadPrivateKeyFromJsonFile loads a password encrypted private key from a .json file
func LoadPrivateKeyFromPemFile ¶
LoadPrivateKeyFromPemFile loads a private key from a .pem file
func SavePrivateKeyToJsonFile ¶
SavePrivateKeyToJsonFile saves a password encrypted private key to a .json file
func SavePrivateKeyToPemFile ¶
SavePrivateKeyToPemFile saves the private key in a .pem file
func SignTransaction ¶
func SignTransaction(tx *data.Transaction, privateKey []byte) error
SignTransaction signs a transaction with the provided private key
func SignTransactionHash ¶
func SignTransactionHash(tx *data.Transaction, privateKey []byte) error
SignTransactionHash signs a transaction with the provided private key Also known as "version 2" transactions, their signatures are computed upon the sha256 hash of the marshalized transaction instead of the plain marshalized transaction
Types ¶
This section is empty.