Documentation ¶
Overview ¶
Package wallet models the data for a wallet It is not a complete wallet and only provides basic testing capabilities for rpc currently
Index ¶
- Constants
- func InitWallet()
- func IsUnlockable(scriptPubKey *script.Script) bool
- type AddressBook
- type AddressBookData
- type Recipient
- type ScriptStore
- type Wallet
- func (w *Wallet) AddScript(s *script.Script) error
- func (w *Wallet) AddToWallet(txn *tx.Tx, blockhash util.Hash, extInfo map[string]string) error
- func (w *Wallet) GenerateNewKey() (*crypto.PublicKey, error)
- func (w *Wallet) GetBalance() amount.Amount
- func (w *Wallet) GetBroadcastTx() bool
- func (w *Wallet) GetCreditOut(out *txout.TxOut, filter uint8) amount.Amount
- func (w *Wallet) GetCreditTx(walletTx *WalletTx, filter uint8) amount.Amount
- func (w *Wallet) GetDebitIn(in *txin.TxIn, filter uint8) amount.Amount
- func (w *Wallet) GetDebitTx(walletTx *WalletTx, filter uint8) amount.Amount
- func (w *Wallet) GetMinimumFee(byteSize int) int64
- func (w *Wallet) GetReservedKey() (*crypto.PublicKey, error)
- func (w *Wallet) GetUnspentCoin(outPoint *outpoint.OutPoint) *utxo.Coin
- func (w *Wallet) GetWalletTx(txhash util.Hash) *WalletTx
- func (w *Wallet) GetWalletTxns() []*WalletTx
- func (w *Wallet) HandleRelatedMempoolTx(txe *tx.Tx)
- func (w *Wallet) Init() error
- func (w *Wallet) IsEnable() bool
- func (w *Wallet) IsMine(out *txout.TxOut) uint8
- func (w *Wallet) IsTrusted(walletTx *WalletTx) bool
- func (w *Wallet) MarkSpent(outPoint *outpoint.OutPoint)
- func (w *Wallet) RemoveFromWallet(txn *tx.Tx) error
- func (w *Wallet) SetAddressBook(keyHash []byte, account string, purpose string) error
- func (w *Wallet) SetBroadcastTx(broadcastTx bool)
- func (w *Wallet) SetFeeRate(feePaid int64, byteSize int64)
- type WalletDB
- type WalletTx
- func (wtx *WalletTx) CheckFinalForForCurrentBlock() bool
- func (wtx *WalletTx) GetAvailableCredit(useCache bool) amount.Amount
- func (wtx *WalletTx) GetBlokHeight() int32
- func (wtx *WalletTx) GetCredit(filter uint8) amount.Amount
- func (wtx *WalletTx) GetDebit(filter uint8) amount.Amount
- func (wtx *WalletTx) GetDepthInMainChain() int32
- func (wtx *WalletTx) GetUnspentCoin(index int) *utxo.Coin
- func (wtx *WalletTx) MarkSpent(index int)
- func (wtx *WalletTx) Serialize(writer io.Writer) error
- func (wtx *WalletTx) SerializeSize() int
- func (wtx *WalletTx) Unserialize(reader io.Reader) error
Constants ¶
View Source
const ( ISMINE_NO uint8 = 0 ISMINE_WATCH_UNSOLVABLE uint8 = 1 ISMINE_WATCH_SOLVABLE uint8 = 2 ISMINE_WATCH_ONLY uint8 = ISMINE_WATCH_SOLVABLE | ISMINE_WATCH_UNSOLVABLE ISMINE_SPENDABLE uint8 = 4 ISMINE_ALL uint8 = ISMINE_WATCH_ONLY | ISMINE_SPENDABLE )
Variables ¶
This section is empty.
Functions ¶
func InitWallet ¶
func InitWallet()
func IsUnlockable ¶
Types ¶
type AddressBook ¶
func NewAddressBook ¶
func NewAddressBook() *AddressBook
func (*AddressBook) GetAccountName ¶
func (ab *AddressBook) GetAccountName(keyHash []byte) string
func (*AddressBook) SetAddressBook ¶
func (ab *AddressBook) SetAddressBook(keyHash []byte, addressBookData *AddressBookData)
type AddressBookData ¶
func NewAddressBookData ¶
func NewAddressBookData(account string, purpose string) *AddressBookData
func NewEmptyAddressBookData ¶
func NewEmptyAddressBookData() *AddressBookData
func (*AddressBookData) SerializeSize ¶
func (abd *AddressBookData) SerializeSize() int
func (*AddressBookData) Unserialize ¶
func (abd *AddressBookData) Unserialize(reader io.Reader) error
type ScriptStore ¶
func NewScriptStore ¶
func NewScriptStore() *ScriptStore
func (*ScriptStore) AddScript ¶
func (ss *ScriptStore) AddScript(s *script.Script)
type Wallet ¶
type Wallet struct { *crypto.KeyStore *ScriptStore *AddressBook // contains filtered or unexported fields }
func GetInstance ¶
func GetInstance() *Wallet
func (*Wallet) AddToWallet ¶
func (*Wallet) GetBalance ¶
func (*Wallet) GetBroadcastTx ¶
func (*Wallet) GetCreditOut ¶
func (*Wallet) GetCreditTx ¶
func (*Wallet) GetDebitTx ¶
func (*Wallet) GetMinimumFee ¶
func (*Wallet) GetUnspentCoin ¶
func (*Wallet) GetWalletTxns ¶
func (*Wallet) HandleRelatedMempoolTx ¶
func (*Wallet) SetAddressBook ¶
func (*Wallet) SetBroadcastTx ¶
func (*Wallet) SetFeeRate ¶
type WalletTx ¶
type WalletTx struct { *tx.Tx ExtInfo map[string]string TimeReceived int64 /** * FromMe flag is set to true for transactions that were created by the wallet * on this bitcoin node, and set to 0 for transactions that were created * externally and came in through the network or sendrawtransaction RPC. */ IsFromMe bool FromAccount string // contains filtered or unexported fields }
func NewEmptyWalletTx ¶
func NewEmptyWalletTx() *WalletTx
func NewWalletTx ¶
func (*WalletTx) CheckFinalForForCurrentBlock ¶
func (*WalletTx) GetAvailableCredit ¶
func (*WalletTx) GetBlokHeight ¶
func (*WalletTx) GetDepthInMainChain ¶
func (*WalletTx) SerializeSize ¶
Click to show internal directories.
Click to hide internal directories.