crypto

package
v0.0.8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 29, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateBase58PrvKey

func GenerateBase58PrvKey(a Account) (string, error)

GenerateBase58PrvKey return base58 private key

func GenerateHexPrvKey

func GenerateHexPrvKey(a Account) (string, error)

GenerateHexPrvKey return hex private key

Types

type Account

type Account struct {
	Address    common.Address
	PrivateKey ed25519.PrivateKey
}

func AccountFromBase58Key

func AccountFromBase58Key(key string) (Account, error)

AccountFromBase58Key generate an account by base58 private key

func AccountFromBytes

func AccountFromBytes(b []byte) (Account, error)

AccountFromBytes generate an account by bytes

func AccountFromHexKey

func AccountFromHexKey(key string) (Account, error)

AccountFromHexKey generate an account by hex private key

func AccountFromKeygenFile

func AccountFromKeygenFile(file string) (Account, error)

AccountFromKeygenFile generate an account by keygen file

func AccountFromMnemonic

func AccountFromMnemonic(mnemonic string, args ...interface{}) (Account, error)

AccountFromMnemonic generate an account by mnemonic @params [args]: password--> string @params [args]: path --> bool[true] (default: m/44'/501'/0'/0') @params [args]: path --> string (format: m/44'/501'/0'/0')

func AccountFromSeed

func AccountFromSeed(seed []byte) (Account, error)

AccountFromSeed generate an account by seed

func GenerateAccount

func GenerateAccount() (Account, error)

GenerateAccount Random a new account from ed25519

func (Account) Sign

func (a Account) Sign(message []byte) []byte

Sign the message with account

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL