Documentation ¶
Index ¶
- type Entity
- type EntityRepository
- type MarketHour
- type MarketHourRepo
- type NoteRepository
- type Receiver
- type Round
- func (r *Round) EndFinalization(forfeitTxs []string, txid string) ([]RoundEvent, error)
- func (r *Round) Events() []RoundEvent
- func (r *Round) Fail(err error) []RoundEvent
- func (r *Round) IsEnded() bool
- func (r *Round) IsFailed() bool
- func (r *Round) IsStarted() bool
- func (r *Round) On(event RoundEvent, replayed bool)
- func (r *Round) RegisterTxRequests(txRequests []TxRequest) ([]RoundEvent, error)
- func (r *Round) StartFinalization(connectorAddress string, connectors []string, vtxoTree tree.VtxoTree, ...) ([]RoundEvent, error)
- func (r *Round) StartRegistration() ([]RoundEvent, error)
- func (r *Round) Sweep()
- func (r *Round) TotalInputAmount() uint64
- func (r *Round) TotalOutputAmount() uint64
- type RoundEvent
- type RoundEventRepository
- type RoundFailed
- type RoundFinalizationStarted
- type RoundFinalized
- type RoundRepository
- type RoundStage
- type RoundStarted
- type Stage
- type TxRequest
- type TxRequestsRegistered
- type Vtxo
- type VtxoKey
- type VtxoRepository
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type EntityRepository ¶
type MarketHour ¶
type MarketHour struct { StartTime time.Time EndTime time.Time Period time.Duration RoundInterval time.Duration UpdatedAt time.Time }
func NewMarketHour ¶
func NewMarketHour(startTime, endTime time.Time, period, roundInterval time.Duration) *MarketHour
type MarketHourRepo ¶
type MarketHourRepo interface { Get(ctx context.Context) (*MarketHour, error) Upsert(ctx context.Context, marketHour MarketHour) error Close() }
type NoteRepository ¶
type Round ¶
type Round struct { Id string StartingTimestamp int64 EndingTimestamp int64 Stage Stage TxRequests map[string]TxRequest Txid string UnsignedTx string ForfeitTxs []string VtxoTree tree.VtxoTree Connectors []string ConnectorAddress string DustAmount uint64 Version uint Swept bool // true if all the vtxos are vtxo.Swept or vtxo.Redeemed // contains filtered or unexported fields }
func NewRoundFromEvents ¶
func NewRoundFromEvents(events []RoundEvent) *Round
func (*Round) EndFinalization ¶
func (r *Round) EndFinalization(forfeitTxs []string, txid string) ([]RoundEvent, error)
func (*Round) Events ¶
func (r *Round) Events() []RoundEvent
func (*Round) Fail ¶
func (r *Round) Fail(err error) []RoundEvent
func (*Round) On ¶
func (r *Round) On(event RoundEvent, replayed bool)
func (*Round) RegisterTxRequests ¶
func (r *Round) RegisterTxRequests(txRequests []TxRequest) ([]RoundEvent, error)
func (*Round) StartFinalization ¶
func (*Round) StartRegistration ¶
func (r *Round) StartRegistration() ([]RoundEvent, error)
func (*Round) TotalInputAmount ¶
func (*Round) TotalOutputAmount ¶
type RoundEvent ¶
type RoundEvent interface {
IsEvent()
}
type RoundEventRepository ¶
type RoundFailed ¶
func (RoundFailed) IsEvent ¶
func (r RoundFailed) IsEvent()
type RoundFinalizationStarted ¶
type RoundFinalizationStarted struct { Id string VtxoTree tree.VtxoTree Connectors []string ConnectorAddress string RoundTx string MinRelayFeeRate int64 }
func (RoundFinalizationStarted) IsEvent ¶
func (r RoundFinalizationStarted) IsEvent()
type RoundFinalized ¶
func (RoundFinalized) IsEvent ¶
func (r RoundFinalized) IsEvent()
type RoundRepository ¶
type RoundRepository interface { AddOrUpdateRound(ctx context.Context, round Round) error GetRoundWithId(ctx context.Context, id string) (*Round, error) GetRoundWithTxid(ctx context.Context, txid string) (*Round, error) GetExpiredRoundsTxid(ctx context.Context) ([]string, error) GetRoundsIds(ctx context.Context, startedAfter int64, startedBefore int64) ([]string, error) GetSweptRoundsConnectorAddress(ctx context.Context) ([]string, error) Close() }
type RoundStage ¶
type RoundStage int
const ( UndefinedStage RoundStage = iota RegistrationStage FinalizationStage )
func (RoundStage) String ¶
func (s RoundStage) String() string
type RoundStarted ¶
func (RoundStarted) IsEvent ¶
func (r RoundStarted) IsEvent()
type Stage ¶
type Stage struct { Code RoundStage Ended bool Failed bool }
type TxRequest ¶
func NewTxRequest ¶
func (*TxRequest) AddReceivers ¶
func (TxRequest) TotalInputAmount ¶
func (TxRequest) TotalOutputAmount ¶
type TxRequestsRegistered ¶
func (TxRequestsRegistered) IsEvent ¶
func (r TxRequestsRegistered) IsEvent()
type Vtxo ¶
type VtxoRepository ¶
type VtxoRepository interface { AddVtxos(ctx context.Context, vtxos []Vtxo) error SpendVtxos(ctx context.Context, vtxos []VtxoKey, txid string) error RedeemVtxos(ctx context.Context, vtxos []VtxoKey) error GetVtxos(ctx context.Context, vtxos []VtxoKey) ([]Vtxo, error) GetVtxosForRound(ctx context.Context, txid string) ([]Vtxo, error) SweepVtxos(ctx context.Context, vtxos []VtxoKey) error GetAllVtxos(ctx context.Context, pubkey string) ([]Vtxo, []Vtxo, error) GetAllSweepableVtxos(ctx context.Context) ([]Vtxo, error) UpdateExpireAt(ctx context.Context, vtxos []VtxoKey, expireAt int64) error Close() }
Click to show internal directories.
Click to hide internal directories.