Documentation
¶
Index ¶
- type ForfeitTx
- type MarketHour
- type MarketHourRepo
- type NoteRepository
- type Outpoint
- type Receiver
- type Round
- func (r *Round) EndFinalization(forfeitTxs []ForfeitTx, 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 tree.TxTree, vtxoTree tree.TxTree, ...) ([]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 RoundStats
- type SigningType
- 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 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 []ForfeitTx
VtxoTree tree.TxTree
Connectors tree.TxTree
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 []ForfeitTx, 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.TxTree
Connectors tree.TxTree
ConnectorAddress string
RoundTx string
MinRelayFeeRate int64
ConnectorsIndex map[string]Outpoint
}
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)
GetRoundStats(ctx context.Context, roundTxid string) (*RoundStats, error)
GetRoundForfeitTxs(ctx context.Context, roundTxid string) ([]ForfeitTx, error)
GetRoundConnectorTree(ctx context.Context, roundTxid string) (tree.TxTree, error)
GetVtxoTreeWithTxid(ctx context.Context, txid string) (tree.TxTree, error)
GetExpiredRoundsTxid(ctx context.Context) ([]string, error)
GetRoundsIds(ctx context.Context, startedAfter int64, startedBefore int64) ([]string, error)
GetSweptRoundsConnectorAddress(ctx context.Context) ([]string, error)
GetTxsWithTxids(ctx context.Context, txids []string) ([]string, error)
GetExistingRounds(ctx context.Context, txids []string) (map[string]any, 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 RoundStats ¶
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
GetAllNonRedeemedVtxos(ctx context.Context, pubkey string) ([]Vtxo, []Vtxo, error)
GetAllSweepableVtxos(ctx context.Context) ([]Vtxo, error)
GetSpendableVtxosWithPubKey(ctx context.Context, pubkey string) ([]Vtxo, error)
GetAll(ctx context.Context) ([]Vtxo, error)
GetAllVtxosWithPubKey(ctx context.Context, pubkey string) ([]Vtxo, []Vtxo, error)
GetAllVtxosWithPubKeys(ctx context.Context, pubkeys []string, spendableOnly, spentOnly bool) ([]Vtxo, error)
UpdateExpireAt(ctx context.Context, vtxos []VtxoKey, expireAt int64) error
GetLeafVtxosForRound(ctx context.Context, txid string) ([]Vtxo, error)
Close()
}
Click to show internal directories.
Click to hide internal directories.