wallet

package
v0.0.0-...-65ff5bd Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2023 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AddressChecksumLen = 4
)

Variables

This section is empty.

Functions

func GetPublicKey

func GetPublicKey(addr []byte) []byte

获取钱包公钥

func HashPubKey

func HashPubKey(pubKey []byte) []byte

获取公钥哈希值

func ValidateAddress

func ValidateAddress(address string) bool

验证钱包地址是否可用

Types

type Wallet

type Wallet struct {
	PrivateKey ecdsa.PrivateKey
	PublicKey  []byte
	Address    []byte
}

钱包,存储公钥和私钥

func NewWallet

func NewWallet() *Wallet

新建钱包

func (Wallet) GetAddress

func (w Wallet) GetAddress() string

获取钱包地址 base58(版本号+公钥+校验码)

type Wallets

type Wallets struct {
	List map[string]*Wallet
}

所有钱包

func LoadWallets

func LoadWallets() (*Wallets, error)

从文件加载钱包

func NewWallets

func NewWallets() *Wallets

新建钱包

func (Wallets) NewWallet

func (w Wallets) NewWallet() *Wallet

写入新钱包

func (Wallets) Storage

func (w Wallets) Storage()

保存钱包到文件

Jump to

Keyboard shortcuts

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