wallet

package
v0.0.0 Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2018 License: Unlicense, Unlicense Imports: 21 Imported by: 0

Documentation

Overview

A library for working with a duo blockchain client wallet

Index

Constants

View Source
const (
	Fname = iota
	Ftx
	Facentry
	Fkey
	Fwkey
	Fmkey
	Fckey
	Fkeymeta
	Fdefaultkey
	Fpool
	Fversion
	Fcscript
	Forderposnext
	Faccount
	Fbestblock
	Fminversion
	Flast
)
View Source
const (
	// FeatureBase is the base version number for a wallet
	FeatureBase = 10500
	// FeatureWalletCrypt indicates if the wallet enables encrypted keys
	FeatureWalletCrypt = 40000
	// FeatureCompressedPubKey indicates if the wallet enables compressed public keys
	FeatureCompressedPubKey = 60000
	// FeatureLatest is the newest version of the wallet
	FeatureLatest = 60000
)
View Source
const (
	CurrentVersion = 1
)

Variables

View Source
var (
	ErrPaddingSize = errors.New("padding size error")
	PKCS5          = &pkcs5{}
	// difference with pkcs5 only block must be 8
	PKCS7 = &pkcs5{}
)
View Source
var (
	Filename string
	KeyNames = []string{"name", "tx", "acentry", "key", "wkey", "mkey", "ckey", "keymeta", "defaultkey", "pool", "version", "cscript", "orderposnext", "acc", "bestblock", "minversion"}
	K        = KeyNames
)
View Source
var (
	AccountingEntryNumber = 0
)
View Source
var AllLockedBuffers []*memguard.LockedBuffer
View Source
var AllocatedBufferCount int
View Source
var AllocatedBufferTotalSize int

Functions

func DeleteBuffer

func DeleteBuffer(b *memguard.LockedBuffer)

Deallocates a memguard LockedBuffer and removes it from its register

func DeleteBuffers

func DeleteBuffers(b ...*memguard.LockedBuffer)

Deallocates a slice of buffers

func NewBuffer

func NewBuffer(size int) (B *memguard.LockedBuffer, err error)

Allocates a new memguard LockedBuffer of a given size and keeps track of it

func NewBufferFromBytes

func NewBufferFromBytes(b []byte) (B *memguard.LockedBuffer, err error)

Allocates a new memguard Lockbuffer and fills it with the contents of a byte slice and keeps track of it

func ToJSON

func ToJSON(p interface{}) (j string)

Converts an object into a JSON string

Types

type Account

type Account struct {
	*Serializable
	Account []byte
	Version int32
	Pub     []byte
}

I'm not sure what this is used for

func NewAccount

func NewAccount(s *Serializable) (a *Account)

Creates a new Account

type AccountingEntry

type AccountingEntry struct {
	Account               string
	CreditDebit, Time     int64
	OtherAccount, Comment string
	ValueMap              ValueMap
	OrderPos              int64
	EntryNo               uint64
}

type AddressBook

type AddressBook struct {
	*Serializable
	Pub   []byte
	Label []byte
}

Stores the details of human readable labels for own and others addresses

func NewAddressBook

func NewAddressBook(s *Serializable) (a *AddressBook)

Creates a new AddressBook

func (*AddressBook) Decrypt

func (a *AddressBook) Decrypt() (A AddressBook)

Decrypt an addressbook record

func (*AddressBook) Encrypt

func (a *AddressBook) Encrypt() (A AddressBook)

Encrypt an addressbook record

type BCKey

type BCKey struct {
	Pub  []byte
	Priv []byte
}

A key pair with plaintext public key and AES-256-CBC encrypted private key

type BDefaultKey

type BDefaultKey struct {
	Key []byte
}

Stores the default key that will appear in a wallet interface when creating a payment request

type BKey

type BKey struct {
	Pub  []byte
	Priv []byte
}

Stores unencrypted keys in a wallet.dat

type BMetadata

type BMetadata struct {
	Pub        []byte
	Version    uint32
	CreateTime time.Time
}

Stores key metadata in a wallet.dat

type BName

type BName struct {
	Addr []byte
	Name []byte
}

Stores an address book entry in a wallet.dat

type BWKey

type BWKey struct {
	Pub         []byte
	Priv        []byte
	TimeCreated time.Time
	TimeExpires time.Time
	Comment     string
}

An unencrypted key pair with extra metadata for managing expiry in a wallet.dat

type DB

type DB struct {
	*cete.DB
	UnlockedUntil int64

	Net  string
	Data EncryptedStore
	// contains filtered or unexported fields
}

DB is the structure for encryptable wallet database

func NewDB

func NewDB(path string) (db *DB, err error)

NewDB creates a new DB and opens it - if it already exists it just opens it

func (*DB) Backup

func (db *DB) Backup(*Wallet, string) (err error)

Backup copies the current wallet to another location

func (*DB) Close

func (db *DB) Close() (err error)

Close a wallet.jvzc file

func (*DB) Dump

func (db *DB) Dump() (dump string)

Dump the set of keys and current stats of the chain in a string

func (*DB) Encrypt

func (db *DB) Encrypt() (err error)

Encrypt a wallet.dat database

func (*DB) EraseDefaultKey

func (db *DB) EraseDefaultKey() (err error)

EraseDefaultKey erases the default key

func (*DB) EraseMasterKey

func (db *DB) EraseMasterKey(id int64) (err error)

EraseMasterKey erases a master key record from a wallet database

func (*DB) EraseName

func (db *DB) EraseName(addr string) (err error)

EraseName deletes a name from the wallet

func (*DB) ErasePool

func (db *DB) ErasePool(int64) (err error)

ErasePool erases a KeyPool

func (*DB) EraseTx

func (db *DB) EraseTx(u *Uint.U256) (err error)

EraseTx deletes a transaction from the wallet

func (*DB) Find

func (db *DB) Find(t int, k string) (r *jvzc.Range, err error)

Find searches the wallet database for an item in a specified table with a given key

func (*DB) Flush

func (db *DB) Flush()

Flush forces writing to disk of dirty cache

func (*DB) GetAccountCreditDebit

func (db *DB) GetAccountCreditDebit(string) (err error)

GetAccountCreditDebit gets the Account credit/debit

func (*DB) GetBalance

func (db *DB) GetBalance() float64

GetBalance gets the balance of the wallet

func (*DB) GetKeyPoolSize

func (db *DB) GetKeyPoolSize() int

GetKeyPoolSize gets the keypool size

func (*DB) GetOldestKeyPoolTime

func (db *DB) GetOldestKeyPoolTime() int64

GetOldestKeyPoolTime gets the oldest keypool time

func (*DB) GetUpdateCount

func (db *DB) GetUpdateCount() uint64

GetUpdateCount returns the number of times the wallet has been modified in the current session

func (*DB) ImportWalletDat

func (db *DB) ImportWalletDat(string) (err error)

ImportWalletDat imports an old style BDB wallet.dat file

func (*DB) ListAccountCreditDebit

func (db *DB) ListAccountCreditDebit(string, []*AccountingEntry) (err error)

ListAccountCreditDebit gets the list off accounts and their credit/debits

func (*DB) LoadWallet

func (db *DB) LoadWallet(*Wallet) (err error)

LoadWallet loads the wallet

func (*DB) ReadAccount

func (db *DB) ReadAccount(accname string, acc *Account) (err error)

ReadAccount returns the data of an Account

func (*DB) ReadBestBlock

func (db *DB) ReadBestBlock(*block.Locator) (err error)

ReadBestBlock returns the best block stored in the wallet

func (*DB) ReadPool

func (db *DB) ReadPool(int64, KeyPool) (err error)

ReadPool returns the KeyPool

func (*DB) Recover

func (db *DB) Recover(string) (err error)

Recover recovers everything from the wallet that it can

func (*DB) RecoverOnlyKeys

func (db *DB) RecoverOnlyKeys(string) (err error)

RecoverOnlyKeys recovers only the keys from the wallet

func (*DB) ReorderTransactions

func (db *DB) ReorderTransactions(*Wallet) (err error)

ReorderTransactions reorders transactions in the wallet

func (*DB) Unlock

func (db *DB) Unlock() (err error)

Unlock a wallet.dat database

func (*DB) Verify

func (db *DB) Verify() (err error)

Verify the consistency of a wallet database

func (*DB) Version

func (db *DB) Version() int

Version returns the version of the wallet

func (*DB) WriteAccount

func (db *DB) WriteAccount(string, *Account) (err error)

WriteAccount writes the data of an Account

func (*DB) WriteAccountingEntry

func (db *DB) WriteAccountingEntry(*AccountingEntry) (err error)

WriteAccountingEntry writes an AccountingEntry to the wallet

func (*DB) WriteBestBlock

func (db *DB) WriteBestBlock(*block.Locator) (err error)

WriteBestBlock writes the best block to the wallet

func (*DB) WriteCryptedKey

func (db *DB) WriteCryptedKey(pub *key.Pub, priv []byte, meta *KeyMetadata) (err error)

WriteCryptedKey writes an encrypted key to the wallet

func (*DB) WriteDefaultKey

func (db *DB) WriteDefaultKey(p *key.Pub) (err error)

WriteDefaultKey writes the default key

func (*DB) WriteKey

func (db *DB) WriteKey(key *Key, meta *KeyMetadata) (err error)

WriteKey writes a new key to the wallet

func (*DB) WriteMasterKey

func (db *DB) WriteMasterKey(mkey *MasterKey) (err error)

WriteMasterKey writes a MasterKey to the wallet

func (*DB) WriteMinVersion

func (db *DB) WriteMinVersion(int) (err error)

WriteMinVersion writes the MinVersion

func (*DB) WriteName

func (db *DB) WriteName(n *AddressBook) (err error)

WriteName writes a new name to the database associated with an address

func (*DB) WriteOrderPosNext

func (db *DB) WriteOrderPosNext(p int64) (err error)

WriteOrderPosNext moves the write position to the next

func (*DB) WritePool

func (db *DB) WritePool(int64, KeyPool) (err error)

WritePool writes to the KeyPool

func (*DB) WriteScript

func (db *DB) WriteScript(hashID *Uint.U160, script *key.Script) (err error)

WriteScript writes a script to the wallet

func (*DB) WriteTx

func (db *DB) WriteTx(u *Uint.U256, t []byte) (err error)

WriteTx writes a transaction to the wallet

type EncryptedStore

type EncryptedStore struct {
	*Serializable
	MasterKey    []*MasterKey
	LastLocked   time.Time
	AddressBook  []*AddressBook
	Metadata     []*Metadata
	Key          []*Key
	Wdata        []*Wdata
	Tx           []*Tx
	Pool         []*Pool
	Script       []*Script
	Account      []*Account
	Setting      []*Setting
	DefaultKey   []byte
	BestBlock    []byte
	OrderPosNext int64
	Version      uint32
	MinVersion   uint32
}

A store of all the data related to a wallet with the ability to be encrypted and exported to other data formats

var ES *EncryptedStore

func Import

func Import(pass *memguard.LockedBuffer, filename ...string) (es *EncryptedStore, err error)

Import reads an existing wallet.dat and returns all the keys and address data in it. If a password is given, the private keys in the CKeys array are decrypted and the encrypter/decrypter functions are armed.

func NewEncryptedStore

func NewEncryptedStore() (e *EncryptedStore)

Creates a new EncryptedStore

type Imports

type Imports struct {
	*Serializable
	Names      []BName
	Metadata   []BMetadata
	Keys       []BKey
	WKeys      []BWKey
	CKeys      []BCKey
	DefaultKey BDefaultKey
}

A collection of tables from a wallet.dat file with optional en/decryptors

type Key

type Key struct {
	*Serializable
	Pub  []byte
	Priv []byte
}

A public/private key pair corresponding to a wallet address

func NewKey

func NewKey(s *Serializable) (k *Key)

Creates a new Key

func (*Key) Decrypt

func (k *Key) Decrypt() (K Key)

Decrypt an Key record

type KeyMetadata

type KeyMetadata struct {
	Pub        *key.Pub
	Version    uint32
	CreateTime int64
}

Data structure for storing metadata related to a key pair

func NewKeyMetadata

func NewKeyMetadata(createTime int64) (M *KeyMetadata)

NewKeyMetadata makes a new KeyMetadata structure

type KeyPool

type KeyPool struct {
	Time   int64
	PubKey key.Pub
}

type MasterKey

type MasterKey struct {
	MKeyID       int64
	EncryptedKey []byte
	Salt         []byte
	Method       uint32
	Iterations   uint32
	Other        []byte
}

Stores the details of an encryption master key for a wallet

func NewMasterKey

func NewMasterKey() (e MasterKey)

Creates a new MasterKey

func (*MasterKey) Decrypt

func (m *MasterKey) Decrypt(ckey *memguard.LockedBuffer, iv []byte, b ...[]byte) (r []*memguard.LockedBuffer, err error)

Decrypts ciphertext using the masterkey and a password

func (*MasterKey) Encrypt

func (m *MasterKey) Encrypt(ckey *memguard.LockedBuffer, iv []byte, b ...*memguard.LockedBuffer) (r []*memguard.LockedBuffer, err error)

Encrypts plaintext using the masterkey and a password

type MasterKeyMap

type MasterKeyMap map[uint]*KeyMetadata

type Metadata

type Metadata struct {
	*Serializable
	Pub        []byte
	Version    uint32
	CreateTime []byte
}

Stores version and create time for keys

func NewMetadata

func NewMetadata(s *Serializable) (m *Metadata)

Creates a new

func (*Metadata) Decrypt

func (m *Metadata) Decrypt() (M *Metadata)

Decrypt an metadata record

type Orders

type Orders struct {
	Key, Value string
}

Orders are a key value pair

type Pool

type Pool struct {
	*Serializable
	Index   uint64
	Version uint32
	Time    []byte
	Pub     []byte
}

Keys in reserve for future change operations

func NewPool

func NewPool(s *Serializable) (p *Pool)

Creates a new Pool

type ReserveKey

type ReserveKey struct {
	Index  int64
	PubKey key.Pub
	// contains filtered or unexported fields
}

type ScanState

type ScanState struct {
	Keys, CKeys, KeyMeta      uint
	IsEncrypted, AnyUnordered bool
	FileVersion               int
	WalletUpgrade             []*Uint.U256
}

type Script

type Script struct {
	*Serializable
	ID   []byte
	Data []byte
}

A payment script related to key pairs in the wallet

func NewScript

func NewScript(s *Serializable) (S *Script)

Creates a new Script

type Serializable

type Serializable struct {
	// contains filtered or unexported fields
}

Abstract interface embeddable in other types that you wish to convert to other encodings such as JSON and potentially any type of desired encoding, as well as to enable encryption of sensitive data while it is not being utilised

func (*Serializable) DeriveCipher

func (s *Serializable) DeriveCipher(pass *memguard.LockedBuffer) (mk *MasterKey, k *memguard.LockedBuffer, iv []byte, err error)

Decrypts a ciphertext using the masterkey and password

func (*Serializable) FromJSON

func (s *Serializable) FromJSON(j string) (J string, err error)

Converts a JSON string into the data to fill the parent type

func (*Serializable) Lock

func (s *Serializable) Lock()

Locks the sensitive data that may have been created for an serializable object

type Setting

type Setting struct {
	*Serializable
	Name  string
	Value []byte
}

Stores settings related to the user's wallet

func NewSetting

func NewSetting(s *Serializable) (S *Setting)

Creates a new Setting

type Transaction

type Transaction struct {
	block.MerkleTx

	Prev                                          []block.MerkleTx
	OrderForm                                     []Orders
	TimeReceivedIsTxTime, TimeReceived, TimeSmart uint
	FromMe                                        byte
	FromAccount                                   string
	Spent                                         []byte
	OrderPos                                      int64
	CachedFlags                                   struct {
		Debit, Credit, ImmatureCredit, AvailableCredit, Change bool
	}
	CachedValues struct {
		Debit, Credit, ImmatureCredit, AvailableCredit, Change int64
	}
	// contains filtered or unexported fields
}

type Tx

type Tx struct {
	*Serializable
	TxHash []byte
	TxData []byte
}

A raw transaction related to a key pair in the wallet

func NewTx

func NewTx(s *Serializable) (t *Tx)

Creates a new Tx

type TxItems

type TxItems map[int64]TxPair

type TxOutput

type TxOutput struct {
	Tx       Tx
	I, Depth int
}

type TxPair

type TxPair map[*Tx]*AccountingEntry

type ValueMap

type ValueMap map[string]string

type Wallet

type Wallet struct {
	EncryptedStore
	DB *DB

	FileBacked      bool
	File            string
	KeyPoolSet      []int64
	KeyMetadataMap  map[*key.ID]*KeyMetadata
	MasterKeysMap   MasterKeyMap
	MasterKeyMaxID  uint
	WalletMap       map[*Uint.U256]*Tx
	OrderPosNext    int64
	RequestCountMap map[*Uint.U256]int
	AddressBookMap  map[*key.TxDestination]string
	DefaultKey      *key.Pub
	LockedCoinsSet  []*tx.OutPoint
	TimeFirstKey    int64
	// contains filtered or unexported fields
}

Wallet controls access to a wallet.db file containing keys and data relating to accounts and addresses

func New

func New() *Wallet

New returns a new Wallet

func NewFromFile

func NewFromFile(filename string) *Wallet

NewFromFile makes a new wallet by importing a wallet.dat file

func (*Wallet) AddCryptedKey

func (w *Wallet) AddCryptedKey(*key.Pub, *KeyMetadata) (success bool)

AddCryptedKey -

func (*Wallet) AddKeyPair

func (w *Wallet) AddKeyPair(*key.Priv, *key.Pub) (success bool)

AddKeyPair -

func (*Wallet) AddReserveKey

func (w *Wallet) AddReserveKey(*KeyPool) int64

AddReserveKey -

func (*Wallet) AddScript

func (w *Wallet) AddScript(*key.Script) (success bool)

AddScript -

func (*Wallet) AddToWallet

func (w *Wallet) AddToWallet(Tx) (success bool)

AddToWallet -

func (*Wallet) AddToWalletIfInvolvingMe

func (w *Wallet) AddToWalletIfInvolvingMe(*Uint.U256, *tx.Transaction, *block.Block, bool, bool) (success bool)

AddToWalletIfInvolvingMe -

func (*Wallet) AvailableCoins

func (w *Wallet) AvailableCoins([]TxOutput, bool)

AvailableCoins -

func (*Wallet) CanSupportFeature

func (w *Wallet) CanSupportFeature(int) (success bool)

CanSupportFeature -

func (*Wallet) ChangeWalletPassphrase

func (w *Wallet) ChangeWalletPassphrase(string, string) (success bool)

ChangeWalletPassphrase -

func (*Wallet) CommitTransaction

func (w *Wallet) CommitTransaction(*Tx, *ReserveKey) (success bool)

CommitTransaction -

func (*Wallet) CreateTransaction

func (w *Wallet) CreateTransaction(*key.Script, int64, *Tx, *ReserveKey, int64, string) (success bool)

CreateTransaction -

func (*Wallet) CreateTransactions

func (w *Wallet) CreateTransactions([]map[*key.Script]int64, *Tx, *ReserveKey, int64, string) (success bool)

CreateTransactions -

func (*Wallet) DelAddressBookName

func (w *Wallet) DelAddressBookName(*key.TxDestination) (success bool)

DelAddressBookName -

func (*Wallet) EncryptWallet

func (w *Wallet) EncryptWallet(string)

EncryptWallet -

func (*Wallet) EraseFromWallet

func (w *Wallet) EraseFromWallet(*Uint.U256) (success bool)

EraseFromWallet -

func (*Wallet) GenerateNewKey

func (w *Wallet) GenerateNewKey() *key.Pub

GenerateNewKey -

func (*Wallet) GetAddressBalances

func (w *Wallet) GetAddressBalances() map[*key.TxDestination]int64

GetAddressBalances -

func (*Wallet) GetAddressGroupings

func (w *Wallet) GetAddressGroupings() []key.TxDestination

GetAddressGroupings -

func (*Wallet) GetAllReserveKeys

func (w *Wallet) GetAllReserveKeys() []key.ID

GetAllReserveKeys -

func (*Wallet) GetBalance

func (w *Wallet) GetBalance() int64

GetBalance -

func (*Wallet) GetChange

func (w *Wallet) GetChange(*tx.Out) int64

GetChange -

func (*Wallet) GetCredit

func (w *Wallet) GetCredit(*tx.Out) int64

GetCredit -

func (*Wallet) GetDebit

func (w *Wallet) GetDebit(*tx.In) int64

GetDebit -

func (*Wallet) GetImmatureBalance

func (w *Wallet) GetImmatureBalance() int64

GetImmatureBalance -

func (*Wallet) GetKeyBirthTimes

func (w *Wallet) GetKeyBirthTimes(map[*key.ID]int64)

GetKeyBirthTimes -

func (*Wallet) GetKeyFromPool

func (w *Wallet) GetKeyFromPool(*key.Pub, bool) (success bool)

GetKeyFromPool -

func (*Wallet) GetKeyPoolSize

func (w *Wallet) GetKeyPoolSize() int

GetKeyPoolSize -

func (*Wallet) GetOldestKeyPoolTime

func (w *Wallet) GetOldestKeyPoolTime() int64

GetOldestKeyPoolTime -

func (*Wallet) GetTransaction

func (w *Wallet) GetTransaction(*Uint.U256, *Tx) (success bool)

GetTransaction -

func (*Wallet) GetTxChange

func (w *Wallet) GetTxChange(*tx.Transaction) int64

GetTxChange -

func (*Wallet) GetTxCredit

func (w *Wallet) GetTxCredit(*tx.Transaction) int64

GetTxCredit -

func (*Wallet) GetTxDebit

func (w *Wallet) GetTxDebit(*tx.Transaction) int64

GetTxDebit -

func (*Wallet) GetUnconfirmedBalance

func (w *Wallet) GetUnconfirmedBalance() int64

GetUnconfirmedBalance -

func (*Wallet) GetVersion

func (w *Wallet) GetVersion() int

GetVersion -

func (*Wallet) IncOrderPosNext

func (w *Wallet) IncOrderPosNext(*DB) int64

IncOrderPosNext -

func (*Wallet) Inventory

func (w *Wallet) Inventory(*Uint.U256)

Inventory -

func (*Wallet) IsChange

func (w *Wallet) IsChange(*tx.Out) (success bool)

IsChange -

func (*Wallet) IsFromMe

func (w *Wallet) IsFromMe(*tx.Transaction) (success bool)

IsFromMe -

func (*Wallet) IsLockedCoin

func (w *Wallet) IsLockedCoin(*Uint.U256, uint) (success bool)

IsLockedCoin -

func (*Wallet) IsMyTX

func (w *Wallet) IsMyTX(*tx.Transaction) (success bool)

IsMyTX -

func (*Wallet) IsMyTxIn

func (w *Wallet) IsMyTxIn(*tx.In) (success bool)

IsMyTxIn -

func (*Wallet) IsMyTxOut

func (w *Wallet) IsMyTxOut(*tx.Out) (success bool)

IsMyTxOut -

func (*Wallet) KeepKey

func (w *Wallet) KeepKey(int64)

KeepKey -

func (*Wallet) ListLockedCoins

func (w *Wallet) ListLockedCoins([]tx.OutPoint)

ListLockedCoins -

func (*Wallet) LoadCryptedKey

func (w *Wallet) LoadCryptedKey(*key.Pub, []byte) (success bool)

LoadCryptedKey -

func (*Wallet) LoadKey

func (w *Wallet) LoadKey(*key.Priv, *key.Pub) (success bool)

LoadKey -

func (*Wallet) LoadKeyMetadata

func (w *Wallet) LoadKeyMetadata(*key.Pub, *KeyMetadata) (success bool)

LoadKeyMetadata -

func (*Wallet) LoadMinVersion

func (w *Wallet) LoadMinVersion(int) (success bool)

LoadMinVersion -

func (*Wallet) LoadScript

func (w *Wallet) LoadScript(*key.Script) (success bool)

LoadScript -

func (*Wallet) LoadWallet

func (w *Wallet) LoadWallet(bool) error

LoadWallet -

func (*Wallet) LockCoin

func (w *Wallet) LockCoin(*tx.OutPoint)

LockCoin -

func (*Wallet) MarkDirty

func (w *Wallet) MarkDirty()

MarkDirty -

func (*Wallet) NewKeyPool

func (w *Wallet) NewKeyPool() (success bool)

NewKeyPool -

func (*Wallet) NotifyAddressBookChanged

func (w *Wallet) NotifyAddressBookChanged(*Wallet, *key.TxDestination, string, bool, int)

NotifyAddressBookChanged -

func (*Wallet) NotifyTransactionChanged

func (w *Wallet) NotifyTransactionChanged(*Wallet, *Uint.U256, int)

NotifyTransactionChanged -

func (*Wallet) OrderedTxItems

func (w *Wallet) OrderedTxItems([]AccountingEntry, string) *TxItems

OrderedTxItems -

func (*Wallet) PrintWallet

func (w *Wallet) PrintWallet(*block.Block)

PrintWallet -

func (*Wallet) ReacceptWalletTransactions

func (w *Wallet) ReacceptWalletTransactions()

ReacceptWalletTransactions -

func (*Wallet) ResendWalletTransactions

func (w *Wallet) ResendWalletTransactions()

ResendWalletTransactions -

func (*Wallet) ReserveKeyFromKeyPool

func (w *Wallet) ReserveKeyFromKeyPool(int64, *KeyPool)

ReserveKeyFromKeyPool -

func (*Wallet) ReturnKey

func (w *Wallet) ReturnKey(int64)

ReturnKey -

func (*Wallet) ScanForWalletTransactions

func (w *Wallet) ScanForWalletTransactions(*block.Index, bool) int

ScanForWalletTransactions -

func (*Wallet) SelectCoinsMinConf

func (w *Wallet) SelectCoinsMinConf(int64, int, int, []TxOutput) (err error)

SelectCoinsMinConf -

func (*Wallet) SendMoney

func (w *Wallet) SendMoney(*key.Script, int64, *Tx, bool) string

SendMoney -

func (*Wallet) SendMoneyToDestination

func (w *Wallet) SendMoneyToDestination(*key.TxDestination) string

SendMoneyToDestination -

func (*Wallet) SetAddressBookName

func (w *Wallet) SetAddressBookName(*key.TxDestination, string) (success bool)

SetAddressBookName -

func (*Wallet) SetBestChain

func (w *Wallet) SetBestChain(*block.Locator)

SetBestChain -

func (*Wallet) SetDefaultKey

func (w *Wallet) SetDefaultKey(*key.Pub) (success bool)

SetDefaultKey -

func (*Wallet) SetMaxVersion

func (w *Wallet) SetMaxVersion(int) (success bool)

SetMaxVersion -

func (*Wallet) SetMinVersion

func (w *Wallet) SetMinVersion(int, *DB, bool) (success bool)

SetMinVersion -

func (*Wallet) TopUpKeyPool

func (w *Wallet) TopUpKeyPool() (success bool)

TopUpKeyPool -

func (*Wallet) Unlock

func (w *Wallet) Unlock(string) (success bool)

Unlock -

func (*Wallet) UnlockAllCoins

func (w *Wallet) UnlockAllCoins()

UnlockAllCoins -

func (*Wallet) UnlockCoin

func (w *Wallet) UnlockCoin(*tx.OutPoint)

UnlockCoin -

func (*Wallet) UpdatedTransaction

func (w *Wallet) UpdatedTransaction(*Uint.U256)

UpdatedTransaction -

func (*Wallet) WalletUpdateSpent

func (w *Wallet) WalletUpdateSpent(*tx.Transaction)

WalletUpdateSpent -

type Wdata

type Wdata struct {
	*Serializable
	Pub     []byte
	Created []byte
	Expires []byte
	Comment []byte
}

Extra metadata for key expiry management

func NewWdata

func NewWdata(s *Serializable) (w *Wdata)

Creates a new Wdata

Jump to

Keyboard shortcuts

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