Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrPairNotFound = common.NewError("pair_not_found", "pair not found")
View Source
var ErrPlanNotFound = common.NewError("plan_not_found", "plan not found")
Functions ¶
This section is empty.
Types ¶
type Pair ¶
type Pair struct {
Id string `json:"id"`
Status domain.PairStatus `json:"status"`
Assets []domain.Asset `json:"assets"`
ParticipantAddresses []domain.Address `json:"participant_addresses"`
InvestingPeriod int `json:"investing_period"`
WalletSecurity domain.MultiSigWalletSecurity `json:"wallet_security"`
ProfitSharingStrategy domain.ProfitSharingStrategy `json:"profit_sharing_strategy"`
LossProtection float64 `json:"loss_protection"`
Wallet *domain.MultisigWallet `json:"wallet"`
Assurances map[domain.Asset][]domain.SignedTx `json:"assurances"`
Deposits map[domain.Asset]domain.TxHash `json:"deposits"`
WithdrawTx *domain.SignedTx `json:"withdraw_tx"`
LP map[domain.Asset]domain.TxHash `json:"lp"`
Deadline *time.Time `json:"deadline"`
WithdrawnTx *domain.TxHash `json:"withdrawn_tx"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
}
Pair represents a pair
type PairsQuery ¶
type PairsQuery struct {
*common.BaseProjection
}
PairsQuery is a query that keeps track of all pairs
func NewPairsQuery ¶
NewPairsQuery creates a new PairsQuery
func (*PairsQuery) Callback ¶
func (pq *PairsQuery) Callback(event eventsourcing.Event) error
Callback implements the common.Projection.Callback
func (*PairsQuery) Find ¶
func (pq *PairsQuery) Find( ctx context.Context, status *domain.PairStatus, assets []domain.Asset, assetsOrder bool, participantAddresses []domain.Address, shareValue *int, investingPeriod *int, walletSecurity *domain.MultiSigWalletSecurity, profitSharingStrategy *domain.ProfitSharingStrategy, lossProtection *float64, ) ([]Pair, error)
Find finds pairs by given conditions TODO: Add pagination and order by
type Plan ¶
type Plan struct {
Id string `json:"id"`
Assets []domain.Asset `json:"assets"`
Security domain.MultiSigWalletSecurity `json:"security"`
Strategy domain.ProfitSharingStrategy `json:"strategy"`
Quantum int `json:"quantum"`
LossProtection float64 `json:"loss_protection"`
InvestingPeriod int `json:"investing_period"`
}
type PlansQuery ¶
type PlansQuery struct {
*common.BaseProjection
}
PlansQuery is a query that keeps track of all plans
func NewPlansQuery ¶
NewPlansQuery creates a new PlansQuery
func (*PlansQuery) All ¶
func (pq *PlansQuery) All(ctx context.Context) ([]Plan, error)
All returns all plans
func (*PlansQuery) Callback ¶
func (pq *PlansQuery) Callback(event eventsourcing.Event) error
Callback implements the common.Projection.Callback
Click to show internal directories.
Click to hide internal directories.