Documentation
¶
Index ¶
- Constants
- Variables
- type Address
- type AddressCodec
- type Config
- type Manager
- func (p *Manager) AddAddressFill(addressString string, fill func(a *Address)) (addressRecord *Address, err error)
- func (p *Manager) AddAddressRecord(address *Address) (err error)
- func (p *Manager) AddAddressRecordsBulk(addresses []*Address) (err error)
- func (p *Manager) AddPrivateKey(privateKeyBytes []byte) (address string, err error)
- func (p *Manager) AddPrivateKeyHex(privateKeyHex string) (address string, err error)
- func (p *Manager) AddPrivateKeyHexFill(privateKeyHex string, fillParams func(address *Address)) (addressString string, err error)
- func (p *Manager) DevCheckMemPool()
- func (p *Manager) DevDumpMemPool()
- func (p *Manager) GenerateBit44Address() (addressRecord *Address, err error)
- func (p *Manager) GenerateBit44AddressWithLen(mnemonicLen int) (addressRecord *Address, err error)
- func (p *Manager) GetAddress(address string) (addressRecord *Address, err error)
- func (p *Manager) GetFreeAddressAndSubscribe(serviceId int, userId, invoiceId int64, watchOnly bool) (addressRecord *Address, err error)
- func (p *Manager) IsAddressKnown(address string) bool
- func (p *Manager) NewAddressRecord(addressString string, privateKey []byte) (addressRecord *Address, err error)
- func (p *Manager) NewAddressRecordFill(addressString string, fill func(a *Address)) (addressRecord *Address, err error)
- func (p *Manager) RecoverBit44Address(mnemonic []string) (addressRecord *Address, err error)
- func (p *Manager) WalkAllAddresses(walker func(address *Address))
- type MemPoolOption
- type ObjectsSource
Constants ¶
View Source
const (
DefaultEntropyBitLen = 128
)
Variables ¶
View Source
var ( ErrAddressUnknown = errors.New("unknown address") ErrAddressExists = errors.New("address already exists") ErrConfigStorageEmpty = errors.New("config storage not set") ErrNoFreeAddresses = errors.New("no free addresses") ErrInvalidAddressBytes = errors.New("invalid address bytes") ErrInvalidAddress = errors.New("invalid address string") ErrAddressBytesEmpty = errors.New("address bytes empty") ErrAddressStringEmpty = errors.New("address string empty") ErrPrivateKeyEmpty = errors.New("private key empty") ErrAddressPrivateKeyMismatch = errors.New("address and private key mismatch") ErrInvalidMnemonicLen = errors.New("invalid mnemonic length") )
Functions ¶
This section is empty.
Types ¶
type Address ¶
type Address struct {
Address string `json:"address" storm:"id"`
AddressBytes []byte `json:"addressBytes" storm:"index"`
PrivateKey []byte `json:"privateKey"`
Master bool `json:"master"`
Subscribed bool `json:"subscribed"`
ServiceId int `json:"serviceId"`
UserId int64 `json:"userId"`
InvoiceId int64 `json:"invoiceId"`
WatchOnly bool `json:"watchOnly"`
Bip39Support bool `json:"bip39Support,omitempty"`
Bip39Mnemonic []string `json:"bip39Mnemonic,omitempty"`
}
type AddressCodec ¶
type Config ¶
type Config struct {
Debug bool `json:"debug"`
EnableAddressGenerate bool `json:"enableAddressGenerate"`
MinFreePoolSize int `json:"minFreePoolSize"`
GeneratePoolUpTo int `json:"generatePoolUpTo"`
Bip39Support bool `json:"bip39Support"`
Bip36MnemonicLen int `json:"bip36MnemonicLen"`
Bip44CoinType string `json:"bip44CoinType"`
Bip32DerivationPath string `json:"bip32DerivationPath"`
// contains filtered or unexported fields
}
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
func NewManager ¶
func NewManager(options ...MemPoolOption) (pool *Manager, err error)
func (*Manager) AddAddressFill ¶
func (*Manager) AddAddressRecord ¶
func (*Manager) AddAddressRecordsBulk ¶
func (*Manager) AddPrivateKey ¶
func (*Manager) AddPrivateKeyHex ¶
func (*Manager) AddPrivateKeyHexFill ¶
func (*Manager) DevCheckMemPool ¶
func (p *Manager) DevCheckMemPool()
func (*Manager) DevDumpMemPool ¶
func (p *Manager) DevDumpMemPool()
func (*Manager) GenerateBit44Address ¶
func (*Manager) GenerateBit44AddressWithLen ¶
func (*Manager) GetAddress ¶
func (*Manager) GetFreeAddressAndSubscribe ¶
func (*Manager) IsAddressKnown ¶
func (*Manager) NewAddressRecord ¶
func (*Manager) NewAddressRecordFill ¶
func (*Manager) RecoverBit44Address ¶
func (*Manager) WalkAllAddresses ¶
type MemPoolOption ¶
func WithAddressCodec ¶
func WithAddressCodec(codec AddressCodec) MemPoolOption
func WithAddressStorage ¶
func WithAddressStorage(store storage.SimpleStorage) MemPoolOption
func WithConfigStorage ¶
func WithConfigStorage(store storage.BinStorage) MemPoolOption
type ObjectsSource ¶
type ObjectsSource interface {
// AppendKeys should append the keys of the maps to the supplied slice and return the resulting slice
AppendKeys([]string) []string
// Get should return the value for the supplied key
Get(string) *Address
}
ObjectsSource is for supplying data to initialise fastStore
Click to show internal directories.
Click to hide internal directories.