Documentation
¶
Index ¶
- Variables
- func ExistsInHistory(hists []*History, h *tx.InoutHash) bool
- func GetAllPrivateKeys(s *aklib.DBConfig) ([]string, error)
- type History
- func (*History) Descriptor() ([]byte, []int)
- func (this *History) Equal(that interface{}) bool
- func (m *History) Marshal() (dAtA []byte, err error)
- func (m *History) MarshalTo(dAtA []byte) (int, error)
- func (*History) ProtoMessage()
- func (m *History) Reset()
- func (m *History) Size() (n int)
- func (m *History) String() string
- func (m *History) Unmarshal(dAtA []byte) error
- func (m *History) XXX_DiscardUnknown()
- func (m *History) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (dst *History) XXX_Merge(src proto.Message)
- func (m *History) XXX_Size() int
- func (m *History) XXX_Unmarshal(b []byte) error
- type Pool
- func (*Pool) Descriptor() ([]byte, []int)
- func (this *Pool) Equal(that interface{}) bool
- func (m *Pool) Marshal() (dAtA []byte, err error)
- func (m *Pool) MarshalTo(dAtA []byte) (int, error)
- func (*Pool) ProtoMessage()
- func (m *Pool) Reset()
- func (m *Pool) Size() (n int)
- func (m *Pool) String() string
- func (m *Pool) Unmarshal(dAtA []byte) error
- func (m *Pool) XXX_DiscardUnknown()
- func (m *Pool) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (dst *Pool) XXX_Merge(src proto.Message)
- func (m *Pool) XXX_Size() int
- func (m *Pool) XXX_Unmarshal(b []byte) error
- type TxType
- type Wallet
- func (w *Wallet) AddHistory(s *aklib.DBConfig, hist ...*History) error
- func (w *Wallet) AllAddress() []string
- func (w *Wallet) DecryptSeed(pwd []byte) ([]byte, error)
- func (*Wallet) Descriptor() ([]byte, []int)
- func (this *Wallet) Equal(that interface{}) bool
- func (w *Wallet) FillPool(s *aklib.DBConfig, pwdd []byte) error
- func (w *Wallet) FindAddress(adrstr ...string) bool
- func (w *Wallet) FindAddressByte(cfg *aklib.DBConfig, adrstr ...address.Bytes) (bool, error)
- func (w *Wallet) GetAddress(s *aklib.DBConfig, isPublic bool, idx uint32, pwd []byte) (*address.Address, error)
- func (w *Wallet) GetAddressHistory(s *aklib.DBConfig, adr string) ([]*tx.InoutHash, error)
- func (w *Wallet) GetAddressHistory2(s *aklib.DBConfig, adr string) ([]*History, error)
- func (w *Wallet) GetAllUTXO(s *aklib.DBConfig, pwd []byte) ([]*tx.UTXO, uint64, error)
- func (w *Wallet) GetHistory(s *aklib.DBConfig, t TxType) ([]*History, error)
- func (w *Wallet) GetOTAddress(s *aklib.DBConfig, idx uint32, pwd []byte) (*sidh.PrivateKey, error)
- func (w *Wallet) GetUTXO(s *aklib.DBConfig, pwd []byte, pendingUtxos map[[34]byte]tx.Hash, ...) ([]*tx.UTXO, uint64, error)
- func (w *Wallet) GetUTXOFromHistory(s *aklib.DBConfig, pwd []byte, pendingUtxos map[[34]byte]tx.Hash, ...) ([]*tx.UTXO, uint64, error)
- func (w *Wallet) HasAddress(s *aklib.DBConfig, out *tx.MultiSigOut) (bool, error)
- func (w *Wallet) InitSeed(s *aklib.DBConfig, pwd []byte) error
- func (m *Wallet) Marshal() (dAtA []byte, err error)
- func (m *Wallet) MarshalTo(dAtA []byte) (int, error)
- func (w *Wallet) NewAddress(s *aklib.DBConfig, pwd []byte, isPublic bool) (*address.Address, error)
- func (w *Wallet) NewOTAddress(s *aklib.DBConfig, pwd []byte) (*sidh.PrivateKey, error)
- func (w *Wallet) NewPublicAddressFromPool(s *aklib.DBConfig) (string, error)
- func (*Wallet) ProtoMessage()
- func (m *Wallet) Reset()
- func (m *Wallet) Size() (n int)
- func (m *Wallet) String() string
- func (m *Wallet) Unmarshal(dAtA []byte) error
- func (w *Wallet) UpdateHistory(s *aklib.DBConfig, hist ...*History) error
- func (w *Wallet) UpdateHistoryTxn(b *bolt.Bucket, hist ...*History) error
- func (m *Wallet) XXX_DiscardUnknown()
- func (m *Wallet) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (dst *Wallet) XXX_Merge(src proto.Message)
- func (m *Wallet) XXX_Size() int
- func (m *Wallet) XXX_Unmarshal(b []byte) error
Constants ¶
This section is empty.
Variables ¶
var ( ErrInvalidLengthWalletimpl = fmt.Errorf("proto: negative length found during unmarshaling") ErrIntOverflowWalletimpl = fmt.Errorf("proto: integer overflow") )
Functions ¶
func ExistsInHistory ¶
ExistsInHistory returns true if h is in hists.
Types ¶
type History ¶
type History struct { No uint64 `protobuf:"varint,1,opt,name=no,proto3" json:"no,omitempty"` OTAddress string `protobuf:"bytes,2,opt,name=otaddress,proto3" json:"otaddress,omitempty"` OTAReceived bool `protobuf:"varint,3,opt,name=otareceived,proto3" json:"otareceived,omitempty"` Received time.Time `protobuf:"bytes,4,opt,name=received,proto3,stdtime" json:"received"` *tx.InoutHash `protobuf:"bytes,5,opt,name=inout_hash,json=inoutHash,proto3,embedded=inout_hash" json:"inout_hash,omitempty"` Address string `protobuf:"bytes,6,opt,name=address,proto3" json:"address,omitempty"` Value uint64 `protobuf:"varint,7,opt,name=value,proto3" json:"value,omitempty"` IsUtxo bool `protobuf:"varint,8,opt,name=is_utxo,json=isUtxo,proto3" json:"is_utxo,omitempty"` Out *tx.InoutHash `protobuf:"bytes,9,opt,name=out,proto3" json:"out,omitempty"` Confirmed bool `protobuf:"varint,10,opt,name=confirmed,proto3" json:"confirmed,omitempty"` Rejected bool `protobuf:"varint,11,opt,name=rejected,proto3" json:"rejected,omitempty"` }
History is a tx history for an account.
func NewPopulatedHistory ¶
func (*History) Descriptor ¶
func (*History) ProtoMessage ¶
func (*History) ProtoMessage()
func (*History) XXX_DiscardUnknown ¶
func (m *History) XXX_DiscardUnknown()
func (*History) XXX_Marshal ¶
func (*History) XXX_Unmarshal ¶
type Pool ¶
type Pool struct { Index uint32 `protobuf:"varint,1,opt,name=index,proto3" json:"index,omitempty"` Address []string `protobuf:"bytes,2,rep,name=address,proto3" json:"address,omitempty"` }
Pool is a pool for addresses.
func NewPopulatedPool ¶
func (*Pool) Descriptor ¶
func (*Pool) ProtoMessage ¶
func (*Pool) ProtoMessage()
func (*Pool) XXX_DiscardUnknown ¶
func (m *Pool) XXX_DiscardUnknown()
func (*Pool) XXX_Unmarshal ¶
type TxType ¶
type TxType byte
TxType defines types in wallet history db.
func GetTxType ¶
func GetTxType(t tx.InOutHashType) TxType
GetTxType converts tx.InOutHashType to a type in wewallet db
type Wallet ¶
type Wallet struct { AccountName string `protobuf:"bytes,1,opt,name=account_name,json=accountName,proto3" json:"account_name,omitempty"` EncSeed []byte `protobuf:"bytes,2,opt,name=enc_seed,json=encSeed,proto3" json:"enc_seed,omitempty"` AddressChange map[string]uint32 `` /* 189-byte string literal not displayed */ AddressPublic map[string]uint32 `` /* 189-byte string literal not displayed */ AddressOT map[string]uint32 `` /* 177-byte string literal not displayed */ Pool *Pool `protobuf:"bytes,6,opt,name=pool,proto3" json:"pool,omitempty"` }
Wallet represents a wallet in RPC..
func NewFromPriv ¶
NewFromPriv creates a new wallet from private key.
func NewPopulatedWallet ¶
func (*Wallet) AddHistory ¶
AddHistory updates address, isUtxo and value fields in histories and adds to db .
func (*Wallet) AllAddress ¶
AllAddress returns all addresses in the wallet.
func (*Wallet) DecryptSeed ¶
DecryptSeed decrypts the seed of wallet.
func (*Wallet) Descriptor ¶
func (*Wallet) FindAddress ¶
FindAddress returns true if wallet has adrstr.
func (*Wallet) FindAddressByte ¶
FindAddressByte returns true if wallet has adrstr.
func (*Wallet) GetAddress ¶
func (w *Wallet) GetAddress(s *aklib.DBConfig, isPublic bool, idx uint32, pwd []byte) (*address.Address, error)
GetAddress returns an address struct.
func (*Wallet) GetAddressHistory ¶
GetAddressHistory returns InoutHash of adr.
func (*Wallet) GetAddressHistory2 ¶
GetAddressHistory2 returns History of adr.
func (*Wallet) GetAllUTXO ¶
GetAllUTXO returns all UTXOs with balance.
func (*Wallet) GetHistory ¶
GetHistory gets histories of addresses in wallet.
func (*Wallet) GetOTAddress ¶
GetOTAddress returns an sike privatekey..
func (*Wallet) GetUTXO ¶
func (w *Wallet) GetUTXO(s *aklib.DBConfig, pwd []byte, pendingUtxos map[[34]byte]tx.Hash, isPublic bool) ([]*tx.UTXO, uint64, error)
GetUTXO returns UTXOs with balance.
func (*Wallet) GetUTXOFromHistory ¶
func (w *Wallet) GetUTXOFromHistory(s *aklib.DBConfig, pwd []byte, pendingUtxos map[[34]byte]tx.Hash, isPublic bool) ([]*tx.UTXO, uint64, error)
GetUTXOFromHistory returns UTXOs with balance.
func (*Wallet) HasAddress ¶
HasAddress returns true if wallet has an address in the multisg address.
func (*Wallet) NewAddress ¶
NewAddress creates an address in wallet.
func (*Wallet) NewOTAddress ¶
NewOTAddress creates an one-time address in wallet.
func (*Wallet) NewPublicAddressFromPool ¶
NewPublicAddressFromPool get a public address from pool.
func (*Wallet) ProtoMessage ¶
func (*Wallet) ProtoMessage()
func (*Wallet) UpdateHistory ¶
UpdateHistory updates histroies. hist must be gotten by GetHistory func. Don't newly add histories to hist.
func (*Wallet) UpdateHistoryTxn ¶
UpdateHistoryTxn updates histroies. hist must be gotten by GetHistory func. Don't newly add histories to hist.
func (*Wallet) XXX_DiscardUnknown ¶
func (m *Wallet) XXX_DiscardUnknown()