Documentation ¶
Index ¶
- type Builder
- func (b *Builder) Build(plugins ...account.Plugin) (account.Account, error)
- func (b *Builder) Settings() *account.Settings
- func (b *Builder) WithAPI(api *api.API) *Builder
- func (b *Builder) WithAddrGenFunc(f account.AddrGenFunc) *Builder
- func (b *Builder) WithDefaultPlugins() *Builder
- func (b *Builder) WithDepth(depth uint64) *Builder
- func (b *Builder) WithEvents(em event.EventMachine) *Builder
- func (b *Builder) WithInputSelectionStrategy(strat account.InputSelectionFunc) *Builder
- func (b *Builder) WithMWM(mwm uint64) *Builder
- func (b *Builder) WithPrepareTransfersFunc(f account.PrepareTransfersFunc) *Builder
- func (b *Builder) WithSecurityLevel(level consts.SecurityLevel) *Builder
- func (b *Builder) WithSeed(seed Trytes) *Builder
- func (b *Builder) WithSeedProvider(seedProv account.SeedProvider) *Builder
- func (b *Builder) WithStore(store store.Store) *Builder
- func (b *Builder) WithTimeSource(timesource timesrc.TimeSource) *Builder
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Builder ¶
type Builder struct {
// contains filtered or unexported fields
}
Builder wraps a Settings object and provides a builder pattern around it.
func NewBuilder ¶
func NewBuilder() *Builder
NewBuilder creates a new Builder which uses the default settings provided by DefaultSettings().
func (*Builder) WithAddrGenFunc ¶
func (b *Builder) WithAddrGenFunc(f account.AddrGenFunc) *Builder
WithAddrGenFunc sets the address generation function to use.
func (*Builder) WithDefaultPlugins ¶
WithDefaultPlugins adds a transfer poller and promoter-reattacher plugin with following settings:
poll incoming/outgoing transfers every 30 seconds (filter by tail tx hash). promote/reattach each pending transfer every 30 seconds.
This function must only be called after following settings are initialized: API, Store, MWM, Depth, SeedProvider or AddrGen+PrepareTransfers, TimeSource and EventMachine.
func (*Builder) WithEvents ¶
func (b *Builder) WithEvents(em event.EventMachine) *Builder
WithEvents instructs the account to emit events using the given EventMachine.
func (*Builder) WithInputSelectionStrategy ¶
func (b *Builder) WithInputSelectionStrategy(strat account.InputSelectionFunc) *Builder
InputSelectionFunc sets the strategy to determine inputs and usable balance.
func (*Builder) WithPrepareTransfersFunc ¶
func (b *Builder) WithPrepareTransfersFunc(f account.PrepareTransfersFunc) *Builder
WithPrepareTransfersFunc sets the prepare transfers function to use.
func (*Builder) WithSecurityLevel ¶
func (b *Builder) WithSecurityLevel(level consts.SecurityLevel) *Builder
The overall security level used by the account.
func (*Builder) WithSeedProvider ¶
func (b *Builder) WithSeedProvider(seedProv account.SeedProvider) *Builder
SeedProvider sets the underlying SeedProvider to use.
func (*Builder) WithTimeSource ¶
func (b *Builder) WithTimeSource(timesource timesrc.TimeSource) *Builder
TimeSource sets the TimeSource to use to get the current time.