wallet

package
v0.0.0-...-827a594 Latest Latest
Warning

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

Go to latest
Published: Aug 1, 2020 License: MIT Imports: 20 Imported by: 2

Documentation

Index

Constants

View Source
const WalletFileName = ".gowallet.w02" // version 0.2

Variables

View Source
var AddressNetParams = chaincfg.MainNetParams

Functions

func EncryptKey

func EncryptKey(privateWif string, passKey []byte) (encryptWif string, err error)

BIP38 encrypt implement

func IsFileExists

func IsFileExists() bool

check if user wallet file exists

Types

type FindProgress

type FindProgress func(progress, count, found uint32) (stop bool)

type Wallet

type Wallet struct {
	No      uint32
	Private string
	Address string
	Balance *WalletBalance
}

func NewWallet

func NewWallet(seqNum uint32, private, address string) *Wallet

func (*Wallet) LoadBalance

func (w *Wallet) LoadBalance() (err error)

type WalletAccount

type WalletAccount struct {
	PrivateKey string
	PublicKey  string
}

func NewWalletAccount

func NewWalletAccount(secret, salt []byte) (wa *WalletAccount, err error)

func (*WalletAccount) FindVanities

func (wa *WalletAccount) FindVanities(patterns []string, progress FindProgress) (ws []*Wallet, err error)

Find vanity address

func (*WalletAccount) GenerateWallets

func (wa *WalletAccount) GenerateWallets(start, count uint32) (wallets []*Wallet, err error)

Generate multiple address

func (*WalletAccount) NormalizeVanities

func (wa *WalletAccount) NormalizeVanities(vanities []string) (patterns []string, err error)

type WalletBalance

type WalletBalance struct {
	Satoshi uint64
}

func NewBalance

func NewBalance(satoshi uint64) *WalletBalance

func (*WalletBalance) FmtBtc

func (wb *WalletBalance) FmtBtc() string

func (*WalletBalance) Value

func (wb *WalletBalance) Value() uint64

type WalletFile

type WalletFile struct {
	Wallets []*Wallet
}

func LoadWalletFile

func LoadWalletFile() (wf *WalletFile, err error)

func NewWalletFile

func NewWalletFile(ws []*Wallet) *WalletFile

func (*WalletFile) Save

func (wf *WalletFile) Save() (err error)

Jump to

Keyboard shortcuts

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