service

package
v0.67.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 20, 2023 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Account

type Account struct {
	// contains filtered or unexported fields
}

func NewAccount

func NewAccount(aStore AccountStore, bStore BalanceStore, log *logging.Logger) *Account

func (*Account) AddAccountBalance

func (a *Account) AddAccountBalance(b entities.AccountBalance) error

func (*Account) Flush

func (a *Account) Flush(ctx context.Context) error

func (*Account) GetAll

func (a *Account) GetAll(ctx context.Context) ([]entities.Account, error)

func (*Account) GetByID

func (a *Account) GetByID(ctx context.Context, id entities.AccountID) (entities.Account, error)

func (*Account) ObserveAccountBalances

func (a *Account) ObserveAccountBalances(ctx context.Context, retries int, marketID string,
	partyID string, asset string, ty vega.AccountType,
) (accountCh <-chan []entities.AccountBalance, ref uint64)

func (*Account) Obtain

func (a *Account) Obtain(ctx context.Context, acc *entities.Account) error

func (*Account) Query

func (a *Account) Query(ctx context.Context, filter entities.AccountFilter) ([]entities.Account, error)

func (*Account) QueryAggregatedBalances

func (a *Account) QueryAggregatedBalances(ctx context.Context, filter entities.AccountFilter, dateRange entities.DateRange, pagination entities.CursorPagination) (*[]entities.AggregatedBalance, entities.PageInfo, error)

func (*Account) QueryBalances

func (*Account) QueryBalancesV1

func (a *Account) QueryBalancesV1(ctx context.Context, filter entities.AccountFilter, pagination entities.OffsetPagination) ([]entities.AccountBalance, error)

type AccountSource

type AccountSource interface {
	GetByID(ctx context.Context, id entities.AccountID) (entities.Account, error)
}

type AccountStore

type AccountStore interface {
	GetByID(ctx context.Context, id entities.AccountID) (entities.Account, error)
	GetAll(ctx context.Context) ([]entities.Account, error)
	Obtain(ctx context.Context, a *entities.Account) error
	Query(ctx context.Context, filter entities.AccountFilter) ([]entities.Account, error)
	QueryBalancesV1(ctx context.Context, filter entities.AccountFilter, pagination entities.OffsetPagination) ([]entities.AccountBalance, error)
	QueryBalances(ctx context.Context, filter entities.AccountFilter, pagination entities.CursorPagination) ([]entities.AccountBalance, entities.PageInfo, error)
}

type Asset

type Asset struct{ *sqlstore.Assets }

func NewAsset

func NewAsset(store *sqlstore.Assets, log *logging.Logger) *Asset

type Block

type Block struct{ *sqlstore.Blocks }

func NewBlock

func NewBlock(store *sqlstore.Blocks, log *logging.Logger) *Block

type Chain

type Chain struct {
	// contains filtered or unexported fields
}

func NewChain

func NewChain(store ChainStore, log *logging.Logger) *Chain

func (*Chain) GetChainID

func (c *Chain) GetChainID() (string, error)

GetChainID returns the current chain ID stored in the database (if one is set).

If one is not set, return empty string and no error. If an error occurs,
return empty string and an that error.

It caches the result of calling to the store, so that once we have successfully
retrieved a chain ID, we don't ask again.

func (*Chain) SetChainID

func (c *Chain) SetChainID(chainID string) error

type ChainStore

type ChainStore interface {
	Get(context.Context) (entities.Chain, error)
	Set(context.Context, entities.Chain) error
}

type Checkpoint

type Checkpoint struct{ *sqlstore.Checkpoints }

func NewCheckpoint

func NewCheckpoint(store *sqlstore.Checkpoints, log *logging.Logger) *Checkpoint

type Config

type Config struct {
	Level encoding.LogLevel `long:"log-level"`
}

Config represent the configuration of the candle package.

func NewDefaultConfig

func NewDefaultConfig() Config

NewDefaultConfig creates an instance of the package specific configuration, given a pointer to a logger instance to be used for logging within the package.

type Delegation

type Delegation struct {
	// contains filtered or unexported fields
}

func NewDelegation

func NewDelegation(store delegationStore, log *logging.Logger) *Delegation

func (*Delegation) Add

func (d *Delegation) Add(ctx context.Context, delegation entities.Delegation) error

func (*Delegation) Get

func (d *Delegation) Get(ctx context.Context, partyID *string, nodeID *string, epoch *int64, p entities.Pagination) ([]entities.Delegation, entities.PageInfo, error)

func (*Delegation) GetAll

func (d *Delegation) GetAll(ctx context.Context) ([]entities.Delegation, error)

func (*Delegation) GetDelegationSubscribersCount

func (d *Delegation) GetDelegationSubscribersCount() int32

func (*Delegation) Observe

func (d *Delegation) Observe(ctx context.Context, retries int, partyID, nodeID string) (rewardCh <-chan []entities.Delegation, ref uint64)

type Deposit

type Deposit struct{ *sqlstore.Deposits }

func NewDeposit

func NewDeposit(store *sqlstore.Deposits, log *logging.Logger) *Deposit

type Epoch

type Epoch struct{ *sqlstore.Epochs }

func NewEpoch

func NewEpoch(store *sqlstore.Epochs, log *logging.Logger) *Epoch

type EthereumKeyRotation

type EthereumKeyRotation struct {
	// contains filtered or unexported fields
}

func NewEthereumKeyRotation

func NewEthereumKeyRotation(service ethereumKeyRotationsService, log *logging.Logger) *EthereumKeyRotation

func (*EthereumKeyRotation) Add

func (*EthereumKeyRotation) List

type Governance

type Governance struct {
	// contains filtered or unexported fields
}

func NewGovernance

func NewGovernance(pStore ProposalStore, vStore VoteStore, log *logging.Logger) *Governance

func (*Governance) AddProposal

func (g *Governance) AddProposal(ctx context.Context, p entities.Proposal) error

func (*Governance) AddVote

func (g *Governance) AddVote(ctx context.Context, v entities.Vote) error

func (*Governance) GetByPartyConnection

func (g *Governance) GetByPartyConnection(ctx context.Context, partyID string, pagination entities.CursorPagination) ([]entities.Vote, entities.PageInfo, error)

func (*Governance) GetConnection added in v0.63.0

func (g *Governance) GetConnection(
	ctx context.Context,
	proposalID, partyID *string,
	pagination entities.CursorPagination,
) ([]entities.Vote, entities.PageInfo, error)

func (*Governance) GetNoVotesForProposal

func (g *Governance) GetNoVotesForProposal(ctx context.Context, proposalID string) ([]entities.Vote, error)

func (*Governance) GetProposalByID

func (g *Governance) GetProposalByID(ctx context.Context, id string) (entities.Proposal, error)

func (*Governance) GetProposalByReference

func (g *Governance) GetProposalByReference(ctx context.Context, ref string) (entities.Proposal, error)

func (*Governance) GetProposals

func (g *Governance) GetProposals(ctx context.Context, inState *entities.ProposalState, partyID *string, proposalType *entities.ProposalType,
	pagination entities.CursorPagination,
) ([]entities.Proposal, entities.PageInfo, error)

func (*Governance) GetVotes

func (g *Governance) GetVotes(ctx context.Context, proposalID, partyID *string, value *entities.VoteValue) ([]entities.Vote, error)

func (*Governance) GetVotesByParty

func (g *Governance) GetVotesByParty(ctx context.Context, partyID string) ([]entities.Vote, error)

func (*Governance) GetYesVotesForProposal

func (g *Governance) GetYesVotesForProposal(ctx context.Context, proposalID string) ([]entities.Vote, error)

func (*Governance) ObservePartyVotes

func (g *Governance) ObservePartyVotes(ctx context.Context, retries int, partyID string) (<-chan []entities.Vote, uint64)

func (*Governance) ObserveProposalVotes

func (g *Governance) ObserveProposalVotes(ctx context.Context, retries int, proposalID string) (<-chan []entities.Vote, uint64)

func (*Governance) ObserveProposals

func (g *Governance) ObserveProposals(ctx context.Context, retries int, partyID *string) (<-chan []entities.Proposal, uint64)

type KeyRotations

type KeyRotations struct{ *sqlstore.KeyRotations }

func NewKeyRotations

func NewKeyRotations(store *sqlstore.KeyRotations, log *logging.Logger) *KeyRotations

type Ledger

type Ledger struct {
	// contains filtered or unexported fields
}

func NewLedger

func NewLedger(store ledgerStore, log *logging.Logger) *Ledger

func (*Ledger) AddLedgerEntry

func (l *Ledger) AddLedgerEntry(le entities.LedgerEntry) error

func (*Ledger) AddTransferResponse

func (l *Ledger) AddTransferResponse(le *vega.LedgerMovement)

func (*Ledger) Export added in v0.67.0

func (l *Ledger) Export(
	ctx context.Context,
	partyID, assetID string, dateRange entities.DateRange,
	pagination entities.CursorPagination,
) ([]byte, entities.PageInfo, error)

func (*Ledger) Flush

func (l *Ledger) Flush(ctx context.Context) error

func (*Ledger) GetSubscribersCount

func (l *Ledger) GetSubscribersCount() int32

func (*Ledger) Observe

func (l *Ledger) Observe(ctx context.Context, retries int) (<-chan []*vega.LedgerMovement, uint64)

func (*Ledger) Query added in v0.58.0

type LedgerEntriesStore added in v0.58.0

type LedgerEntriesStore interface {
	Query(filter *entities.LedgerEntryFilter, dateRange entities.DateRange, pagination entities.CursorPagination) (*[]entities.AggregatedLedgerEntry, entities.PageInfo, error)
	Export(ctx context.Context, partyID, assetID string, dateRange entities.DateRange, pagination entities.CursorPagination) ([]byte, entities.PageInfo, error)
}

type LiquidityProvision

type LiquidityProvision struct{ *sqlstore.LiquidityProvision }

func NewLiquidityProvision

func NewLiquidityProvision(store *sqlstore.LiquidityProvision, log *logging.Logger) *LiquidityProvision

type MarginLevelsStore

type MarginLevelsStore interface {
	Add(marginLevel entities.MarginLevels) error
	Flush(ctx context.Context) ([]entities.MarginLevels, error)
	GetMarginLevelsByID(ctx context.Context, partyID, marketID string, pagination entities.OffsetPagination) ([]entities.MarginLevels, error)
	GetMarginLevelsByIDWithCursorPagination(ctx context.Context, partyID, marketID string, pagination entities.CursorPagination) ([]entities.MarginLevels, entities.PageInfo, error)
}

type MarketData

type MarketData struct {
	// contains filtered or unexported fields
}

func NewMarketData

func NewMarketData(store MarketDataStore, log *logging.Logger) *MarketData

func (*MarketData) Add

func (m *MarketData) Add(data *entities.MarketData) error

func (*MarketData) Flush

func (m *MarketData) Flush(ctx context.Context) error

func (*MarketData) GetBetweenDatesByID

func (m *MarketData) GetBetweenDatesByID(ctx context.Context, marketID string, start, end time.Time, pagination entities.Pagination) ([]entities.MarketData, entities.PageInfo, error)

func (*MarketData) GetFromDateByID

func (m *MarketData) GetFromDateByID(ctx context.Context, marketID string, start time.Time, pagination entities.Pagination) ([]entities.MarketData, entities.PageInfo, error)

func (*MarketData) GetMarketDataByID

func (m *MarketData) GetMarketDataByID(ctx context.Context, marketID string) (entities.MarketData, error)

func (*MarketData) GetMarketsData

func (m *MarketData) GetMarketsData(ctx context.Context) ([]entities.MarketData, error)

func (*MarketData) GetToDateByID

func (m *MarketData) GetToDateByID(ctx context.Context, marketID string, end time.Time, pagination entities.Pagination) ([]entities.MarketData, entities.PageInfo, error)

func (*MarketData) Initialise

func (m *MarketData) Initialise(ctx context.Context) error

func (*MarketData) ObserveMarketData

func (m *MarketData) ObserveMarketData(
	ctx context.Context, retries int, marketID []string,
) (<-chan []*entities.MarketData, uint64)

type MarketDataStore

type MarketDataStore interface {
	Add(data *entities.MarketData) error
	Flush(ctx context.Context) ([]*entities.MarketData, error)
	GetMarketDataByID(ctx context.Context, marketID string) (entities.MarketData, error)
	GetMarketsData(ctx context.Context) ([]entities.MarketData, error)
	GetBetweenDatesByID(ctx context.Context, marketID string, start, end time.Time, pagination entities.Pagination) ([]entities.MarketData, entities.PageInfo, error)
	GetFromDateByID(ctx context.Context, marketID string, start time.Time, pagination entities.Pagination) ([]entities.MarketData, entities.PageInfo, error)
	GetToDateByID(ctx context.Context, marketID string, end time.Time, pagination entities.Pagination) ([]entities.MarketData, entities.PageInfo, error)
}

type MarketDepth

type MarketDepth struct {
	// contains filtered or unexported fields
}

func NewMarketDepth

func NewMarketDepth(orderStore OrderStore, logger *logging.Logger) *MarketDepth

func (*MarketDepth) AddOrder

func (m *MarketDepth) AddOrder(order *types.Order, vegaTime time.Time, sequenceNumber uint64)

func (*MarketDepth) GetAllOrders

func (m *MarketDepth) GetAllOrders(market string) map[string]*types.Order

func (*MarketDepth) GetBestAskPrice

func (m *MarketDepth) GetBestAskPrice(market string) *num.Uint

GetBestAskPrice returns the highest bid price in the book.

func (*MarketDepth) GetBestBidPrice

func (m *MarketDepth) GetBestBidPrice(market string) *num.Uint

GetBestBidPrice returns the highest bid price in the book.

func (*MarketDepth) GetBuyPriceLevels

func (m *MarketDepth) GetBuyPriceLevels(market string) int

GetBuyPriceLevels returns the number of non empty buy price levels.

func (*MarketDepth) GetMarketDepth

func (m *MarketDepth) GetMarketDepth(market string, limit uint64) *types.MarketDepth

GetMarketDepth builds up the structure to be sent out to any market depth listeners.

func (*MarketDepth) GetOrderCount

func (m *MarketDepth) GetOrderCount(market string) int64

GetOrderCount returns the number of live orders for the given market.

func (*MarketDepth) GetOrderCountAtPrice

func (m *MarketDepth) GetOrderCountAtPrice(market string, side types.Side, price uint64) uint64

GetOrderCountAtPrice returns the number of orders at the given price level.

func (*MarketDepth) GetPriceLevels

func (m *MarketDepth) GetPriceLevels(market string) int

GetPriceLevels returns the number of non empty price levels.

func (*MarketDepth) GetSellPriceLevels

func (m *MarketDepth) GetSellPriceLevels(market string) int

GetSellPriceLevels returns the number of non empty sell price levels.

func (*MarketDepth) GetTotalVolume

func (m *MarketDepth) GetTotalVolume(market string) int64

GetTotalVolume returns the total volume in the order book.

func (*MarketDepth) GetVolumeAtPrice

func (m *MarketDepth) GetVolumeAtPrice(market string, side types.Side, price uint64) uint64

GetVolumeAtPrice returns the order volume at the given price level.

func (*MarketDepth) Initialise

func (m *MarketDepth) Initialise(ctx context.Context) error

func (*MarketDepth) ObserveDepth

func (m *MarketDepth) ObserveDepth(ctx context.Context, retries int, marketIds []string) (<-chan []*types.MarketDepth, uint64)

func (*MarketDepth) ObserveDepthUpdates

func (m *MarketDepth) ObserveDepthUpdates(ctx context.Context, retries int, marketIds []string) (<-chan []*types.MarketDepthUpdate, uint64)

type MarketStore

type MarketStore interface {
	Upsert(ctx context.Context, market *entities.Market) error
	GetByID(ctx context.Context, marketID string) (entities.Market, error)
	GetAll(ctx context.Context, pagination entities.OffsetPagination) ([]entities.Market, error)
	GetAllPaged(ctx context.Context, marketID string, pagination entities.CursorPagination) ([]entities.Market, entities.PageInfo, error)
}

type Markets

type Markets struct {
	// contains filtered or unexported fields
}

func NewMarkets

func NewMarkets(store MarketStore, log *logging.Logger) *Markets

func (*Markets) GetAll

func (m *Markets) GetAll(ctx context.Context, pagination entities.OffsetPagination) ([]entities.Market, error)

func (*Markets) GetAllPaged

func (m *Markets) GetAllPaged(ctx context.Context, marketID string, pagination entities.CursorPagination) ([]entities.Market, entities.PageInfo, error)

func (*Markets) GetByID

func (m *Markets) GetByID(ctx context.Context, marketID string) (entities.Market, error)

func (*Markets) Initialise

func (m *Markets) Initialise(ctx context.Context) error

func (*Markets) Upsert

func (m *Markets) Upsert(ctx context.Context, market *entities.Market) error

type MultiSig

type MultiSig struct {
	*sqlstore.ERC20MultiSigSignerEvent
}

func NewMultiSig

func NewMultiSig(store *sqlstore.ERC20MultiSigSignerEvent, log *logging.Logger) *MultiSig

type NetworkLimits

type NetworkLimits struct{ *sqlstore.NetworkLimits }

func NewNetworkLimits

func NewNetworkLimits(store *sqlstore.NetworkLimits, log *logging.Logger) *NetworkLimits

type NetworkParameter

type NetworkParameter struct{ *sqlstore.NetworkParameters }

func NewNetworkParameter

func NewNetworkParameter(store *sqlstore.NetworkParameters, log *logging.Logger) *NetworkParameter

type Node

type Node struct{ *sqlstore.Node }

func NewNode

func NewNode(store *sqlstore.Node, log *logging.Logger) *Node

type Notary

type Notary struct{ *sqlstore.Notary }

func NewNotary

func NewNotary(store *sqlstore.Notary, log *logging.Logger) *Notary

type OracleData

type OracleData struct{ *sqlstore.OracleData }

func NewOracleData

func NewOracleData(store *sqlstore.OracleData, log *logging.Logger) *OracleData

type OracleSpec

type OracleSpec struct{ *sqlstore.OracleSpec }

func NewOracleSpec

func NewOracleSpec(store *sqlstore.OracleSpec, log *logging.Logger) *OracleSpec

type Order

type Order struct {
	// contains filtered or unexported fields
}

func NewOrder

func NewOrder(store orderStore, log *logging.Logger) *Order

func (*Order) Add

func (o *Order) Add(order entities.Order) error

func (*Order) Flush

func (o *Order) Flush(ctx context.Context) error

func (*Order) GetAll

func (o *Order) GetAll(ctx context.Context) ([]entities.Order, error)

func (*Order) GetAllVersionsByOrderID

func (o *Order) GetAllVersionsByOrderID(ctx context.Context, id string, p entities.OffsetPagination) ([]entities.Order, error)

func (*Order) GetByMarket

func (o *Order) GetByMarket(ctx context.Context, marketID string, p entities.OffsetPagination) ([]entities.Order, error)

func (*Order) GetByParty

func (o *Order) GetByParty(ctx context.Context, partyID string, p entities.OffsetPagination) ([]entities.Order, error)

func (*Order) GetByReference

func (o *Order) GetByReference(ctx context.Context, reference string, p entities.OffsetPagination) ([]entities.Order, error)

func (*Order) GetLiveOrders

func (o *Order) GetLiveOrders(ctx context.Context) ([]entities.Order, error)

func (*Order) GetOrder

func (o *Order) GetOrder(ctx context.Context, orderID string, version *int32) (entities.Order, error)

func (*Order) ListOrderVersions

func (o *Order) ListOrderVersions(ctx context.Context, orderID string, p entities.CursorPagination) ([]entities.Order, entities.PageInfo, error)

func (*Order) ListOrders

func (o *Order) ListOrders(ctx context.Context, party *string, market *string, reference *string, liveOnly bool,
	p entities.CursorPagination, dateRange entities.DateRange, filter entities.OrderFilter,
) ([]entities.Order, entities.PageInfo, error)

func (*Order) ObserveOrders

func (o *Order) ObserveOrders(ctx context.Context, retries int, market *string, party *string, includeLiquidity bool) (<-chan []entities.Order, uint64)

type OrderStore

type OrderStore interface {
	GetLiveOrders(ctx context.Context) ([]entities.Order, error)
}

type Party

type Party struct{ *sqlstore.Parties }

func NewParty

func NewParty(store *sqlstore.Parties, log *logging.Logger) *Party

type Position

type Position struct {
	// contains filtered or unexported fields
}

func NewPosition

func NewPosition(store PositionStore, log *logging.Logger) *Position

func (*Position) Add

func (p *Position) Add(ctx context.Context, pos entities.Position) error

func (*Position) Flush

func (p *Position) Flush(ctx context.Context) error

func (*Position) GetAll

func (p *Position) GetAll(ctx context.Context) ([]entities.Position, error)

func (*Position) GetByMarket

func (p *Position) GetByMarket(ctx context.Context, marketID string) ([]entities.Position, error)

func (*Position) GetByMarketAndParty

func (p *Position) GetByMarketAndParty(ctx context.Context, marketID string, partyID string) (entities.Position, error)

func (*Position) GetByParty

func (p *Position) GetByParty(ctx context.Context, partyID entities.PartyID) ([]entities.Position, error)

func (*Position) GetByPartyConnection

func (p *Position) GetByPartyConnection(ctx context.Context, partyID entities.PartyID, marketID entities.MarketID, pagination entities.CursorPagination) ([]entities.Position, entities.PageInfo, error)

func (*Position) Observe

func (p *Position) Observe(ctx context.Context, retries int, partyID, marketID string) (<-chan []entities.Position, uint64)

type PositionStore

type PositionStore interface {
	Flush(ctx context.Context) ([]entities.Position, error)
	Add(ctx context.Context, p entities.Position) error
	GetByMarketAndParty(ctx context.Context, marketID string, partyID string) (entities.Position, error)
	GetByMarket(ctx context.Context, marketID string) ([]entities.Position, error)
	GetByParty(ctx context.Context, partyID string) ([]entities.Position, error)
	GetByPartyConnection(ctx context.Context, partyID string, marketID string, pagination entities.CursorPagination) ([]entities.Position, entities.PageInfo, error)
	GetAll(ctx context.Context) ([]entities.Position, error)
}

type ProposalStore

type ProposalStore interface {
	Add(ctx context.Context, p entities.Proposal) error
	GetByID(ctx context.Context, id string) (entities.Proposal, error)
	GetByReference(ctx context.Context, ref string) (entities.Proposal, error)
	Get(ctx context.Context, inState *entities.ProposalState, partyIDStr *string, proposalType *entities.ProposalType,
		pagination entities.CursorPagination) ([]entities.Proposal, entities.PageInfo, error)
}

type ProtocolUpgrade added in v0.59.0

type ProtocolUpgrade struct {
	// contains filtered or unexported fields
}

func NewProtocolUpgrade added in v0.59.0

func NewProtocolUpgrade(pupStore pupStore, log *logging.Logger) *ProtocolUpgrade

func (*ProtocolUpgrade) AddProposal added in v0.61.0

func (*ProtocolUpgrade) GetProtocolUpgradeStarted added in v0.59.0

func (p *ProtocolUpgrade) GetProtocolUpgradeStarted() bool

func (*ProtocolUpgrade) ListProposals added in v0.61.0

func (*ProtocolUpgrade) SetProtocolUpgradeStarted added in v0.59.0

func (p *ProtocolUpgrade) SetProtocolUpgradeStarted()

type Reward

type Reward struct {
	// contains filtered or unexported fields
}

func NewReward

func NewReward(store rewardStore, log *logging.Logger) *Reward

func (*Reward) Add

func (r *Reward) Add(ctx context.Context, reward entities.Reward) error

func (*Reward) GetAll

func (r *Reward) GetAll(ctx context.Context) ([]entities.Reward, error)

func (*Reward) GetByCursor

func (r *Reward) GetByCursor(ctx context.Context, partyID, assetID *string, p entities.CursorPagination) ([]entities.Reward, entities.PageInfo, error)

func (*Reward) GetByOffset

func (r *Reward) GetByOffset(ctx context.Context, partyID *string, assetID *string, p *entities.OffsetPagination) ([]entities.Reward, error)

func (*Reward) GetEpochRewardSummaries added in v0.65.0

func (r *Reward) GetEpochRewardSummaries(ctx context.Context, fromEpoch *uint64, toEpoch *uint64, p entities.CursorPagination) ([]entities.EpochRewardSummary, entities.PageInfo, error)

func (*Reward) GetRewardSubscribersCount

func (r *Reward) GetRewardSubscribersCount() int32

func (*Reward) GetSummaries

func (r *Reward) GetSummaries(ctx context.Context, partyID *string, assetID *string) ([]entities.RewardSummary, error)

func (*Reward) Observe

func (r *Reward) Observe(ctx context.Context, retries int, assetID, partyID string) (rewardCh <-chan []entities.Reward, ref uint64)

type Risk

type Risk struct {
	// contains filtered or unexported fields
}

func NewRisk

func NewRisk(mlStore MarginLevelsStore, accountSource AccountSource, log *logging.Logger) *Risk

func (*Risk) Add

func (r *Risk) Add(marginLevel entities.MarginLevels) error

func (*Risk) Flush

func (r *Risk) Flush(ctx context.Context) error

func (*Risk) GetMarginLevelsByID

func (r *Risk) GetMarginLevelsByID(ctx context.Context, partyID, marketID string, pagination entities.OffsetPagination) ([]entities.MarginLevels, error)

func (*Risk) GetMarginLevelsByIDWithCursorPagination

func (r *Risk) GetMarginLevelsByIDWithCursorPagination(ctx context.Context, partyID, marketID string, pagination entities.CursorPagination) ([]entities.MarginLevels, entities.PageInfo, error)

func (*Risk) ObserveMarginLevels

func (r *Risk) ObserveMarginLevels(
	ctx context.Context, retries int, partyID, marketID string,
) (accountCh <-chan []entities.MarginLevels, ref uint64)

type RiskFactor

type RiskFactor struct{ *sqlstore.RiskFactors }

func NewRiskFactor

func NewRiskFactor(store *sqlstore.RiskFactors, log *logging.Logger) *RiskFactor

type SnapshotData added in v0.65.0

type SnapshotData struct {
	// contains filtered or unexported fields
}

func NewSnapshotData added in v0.65.0

func NewSnapshotData(snapStore snapStore, log *logging.Logger) *SnapshotData

func (*SnapshotData) AddSnapshot added in v0.65.0

func (s *SnapshotData) AddSnapshot(ctx context.Context, snap entities.CoreSnapshotData) error

func (*SnapshotData) ListSnapshots added in v0.65.0

type StakeLinking

type StakeLinking struct{ *sqlstore.StakeLinking }

func NewStakeLinking

func NewStakeLinking(store *sqlstore.StakeLinking, log *logging.Logger) *StakeLinking

type Trade

type Trade struct {
	// contains filtered or unexported fields
}

func NewTrade

func NewTrade(store tradeStore, log *logging.Logger) *Trade

func (*Trade) Add

func (t *Trade) Add(trade *entities.Trade) error

func (*Trade) Flush

func (t *Trade) Flush(ctx context.Context) error

func (*Trade) GetByMarket

func (t *Trade) GetByMarket(ctx context.Context, market string, p entities.OffsetPagination) ([]entities.Trade, error)

func (*Trade) GetByOrderID

func (t *Trade) GetByOrderID(ctx context.Context, order string, market *string, pagination entities.OffsetPagination) ([]entities.Trade, error)

func (*Trade) GetByParty

func (t *Trade) GetByParty(ctx context.Context, party string, market *string, pagination entities.OffsetPagination) ([]entities.Trade, error)

func (*Trade) List

func (t *Trade) List(ctx context.Context,
	marketID entities.MarketID,
	partyID entities.PartyID,
	orderID entities.OrderID,
	pagination entities.CursorPagination,
	dateRange entities.DateRange,
) ([]entities.Trade, entities.PageInfo, error)

func (*Trade) Observe

func (t *Trade) Observe(ctx context.Context, retries int, marketID *string, partyID *string) (<-chan []*entities.Trade, uint64)

type Transfer

type Transfer struct{ *sqlstore.Transfers }

func NewTransfer

func NewTransfer(store *sqlstore.Transfers, log *logging.Logger) *Transfer

type VoteStore

type VoteStore interface {
	Add(ctx context.Context, v entities.Vote) error
	GetYesVotesForProposal(ctx context.Context, proposalIDStr string) ([]entities.Vote, error)
	GetNoVotesForProposal(ctx context.Context, proposalIDStr string) ([]entities.Vote, error)
	GetByParty(ctx context.Context, partyIDStr string) ([]entities.Vote, error)
	GetByPartyConnection(ctx context.Context, partyIDStr string, pagination entities.CursorPagination) ([]entities.Vote, entities.PageInfo, error)
	Get(ctx context.Context, proposalID, partyID *string, value *entities.VoteValue) ([]entities.Vote, error)
	GetConnection(
		ctx context.Context,
		proposalIDStr, partyIDStr *string,
		pagination entities.CursorPagination,
	) ([]entities.Vote, entities.PageInfo, error)
}

type Withdrawal

type Withdrawal struct{ *sqlstore.Withdrawals }

func NewWithdrawal

func NewWithdrawal(store *sqlstore.Withdrawals, log *logging.Logger) *Withdrawal

Directories

Path Synopsis
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL