account

package
v0.0.0-...-425d0f2 Latest Latest
Warning

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

Go to latest
Published: Feb 29, 2024 License: MIT Imports: 10 Imported by: 27

Documentation

Index

Constants

View Source
const MaxPrikeyValueHex = "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364140"

Variables

This section is empty.

Functions

func Base58CheckDecode

func Base58CheckDecode(encoded string) ([]byte, error)

DecodeHexString decodes the given base58check encoded string and returns the version prepended decoded string

func Base58CheckDecodeTestPrint

func Base58CheckDecodeTestPrint(encoded string) ([]byte, error)

DecodeHexString decodes the given base58check encoded string and returns the version prepended decoded string

func Base58CheckEncode

func Base58CheckEncode(dataBytes []byte) string

func Base58CheckEncodeHexString

func Base58CheckEncodeHexString(version, data string) (string, error)

Base58CheckEncodeHexString encodes the given version and data to a base58check encoded string

func Base58CheckEncodeWithVersion

func Base58CheckEncodeWithVersion(version []byte, data []byte) string

func CheckReadableAddress

func CheckReadableAddress(readable string) ([]byte, error)

check address is ok ?

func CheckSignByHash32

func CheckSignByHash32(hash32 []byte, publicKeyBytes33 []byte, signatureBytes64 []byte) (bool, error)

func NewAddressFromPublicKey

func NewAddressFromPublicKey(version []byte, pubKey []byte) []byte

func NewAddressFromPublicKeyV0

func NewAddressFromPublicKeyV0(pubKey []byte) []byte

func NewAddressReadableFromAddress

func NewAddressReadableFromAddress(address []byte) string

Types

type Account

type Account struct {
	AddressReadable string
	Address         []byte
	PublicKey       []byte
	PrivateKey      []byte
	Private         *btcec.PrivateKey
}

func CreateAccountByPassword

func CreateAccountByPassword(password string) *Account

func CreateNewRandomAccount

func CreateNewRandomAccount() *Account

func GetAccountByPrivateKeyOrPassword

func GetAccountByPrivateKeyOrPassword(password string) *Account

func GetAccountByPriviteKey

func GetAccountByPriviteKey(byte []byte) (*Account, error)

func GetAccountByPriviteKeyHex

func GetAccountByPriviteKeyHex(hexstr string) (*Account, error)

Jump to

Keyboard shortcuts

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