service

package
v0.73.13-patch.1 Latest Latest
Warning

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

Go to latest
Published: Feb 6, 2024 License: AGPL-3.0 Imports: 17 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) GetBalancesByTxHash added in v0.71.0

func (a *Account) GetBalancesByTxHash(ctx context.Context, txHash entities.TxHash) ([]entities.AccountBalance, error)

func (*Account) GetByID

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

func (*Account) GetByTxHash added in v0.71.0

func (a *Account) GetByTxHash(ctx context.Context, txHash entities.TxHash) ([]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

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)
	GetByTxHash(ctx context.Context, txHash entities.TxHash) ([]entities.Account, error)
	Obtain(ctx context.Context, a *entities.Account) error
	Query(ctx context.Context, filter entities.AccountFilter) ([]entities.Account, error)
	QueryBalances(ctx context.Context, filter entities.AccountFilter, pagination entities.CursorPagination) ([]entities.AccountBalance, entities.PageInfo, error)
	GetBalancesByTxHash(ctx context.Context, txHash entities.TxHash) ([]entities.AccountBalance, error)
}

type Asset

type Asset struct{ *sqlstore.Assets }

func NewAsset

func NewAsset(store *sqlstore.Assets) *Asset

type Block

type Block struct{ *sqlstore.Blocks }

func NewBlock

func NewBlock(store *sqlstore.Blocks) *Block

type Chain

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

func NewChain

func NewChain(store ChainStore) *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) *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) GetByTxHash added in v0.71.0

func (d *Delegation) GetByTxHash(ctx context.Context, txHash entities.TxHash) ([]entities.Delegation, error)

type Deposit

type Deposit struct{ *sqlstore.Deposits }

func NewDeposit

func NewDeposit(store *sqlstore.Deposits) *Deposit

type Epoch

type Epoch struct{ *sqlstore.Epochs }

func NewEpoch

func NewEpoch(store *sqlstore.Epochs) *Epoch

type EthereumKeyRotation

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

func NewEthereumKeyRotation

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

func (*EthereumKeyRotation) Add

func (*EthereumKeyRotation) GetByTxHash added in v0.71.0

func (*EthereumKeyRotation) List

type FeesStats added in v0.73.0

type FeesStats struct{ *sqlstore.FeesStats }

func NewFeesStats added in v0.73.0

func NewFeesStats(store *sqlstore.FeesStats) *FeesStats

type FundingPayment added in v0.73.0

type FundingPayment struct{ *sqlstore.FundingPayments }

func NewFundingPayment added in v0.73.0

func NewFundingPayment(store *sqlstore.FundingPayments) *FundingPayment

type FundingPeriods added in v0.73.0

type FundingPeriods struct{ *sqlstore.FundingPeriods }

func NewFundingPeriods added in v0.73.0

func NewFundingPeriods(store *sqlstore.FundingPeriods) *FundingPeriods

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) GetProposalsByTxHash added in v0.71.0

func (g *Governance) GetProposalsByTxHash(ctx context.Context, txHash entities.TxHash) ([]entities.Proposal, 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) GetVotesByTxHash added in v0.71.0

func (g *Governance) GetVotesByTxHash(ctx context.Context, txHash entities.TxHash) ([]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) *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 string,
	assetID *string,
	dateRange entities.DateRange,
	writer io.Writer,
) error

func (*Ledger) Flush

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

func (*Ledger) GetByTxHash added in v0.71.0

func (l *Ledger) GetByTxHash(ctx context.Context, txHash entities.TxHash) ([]entities.LedgerEntry, 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) *LiquidityProvision

type MarginLevelsStore

type MarginLevelsStore interface {
	Add(marginLevel entities.MarginLevels) error
	Flush(ctx context.Context) ([]entities.MarginLevels, error)
	GetByTxHash(ctx context.Context, txHash entities.TxHash) ([]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) GetHistoricMarketData added in v0.73.0

func (m *MarketData) GetHistoricMarketData(ctx context.Context, marketID string, start, end *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) 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)
	GetHistoricMarketData(ctx context.Context, marketID string, start, 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)

func (*MarketDepth) PublishAtEndOfBlock added in v0.68.0

func (m *MarketDepth) PublishAtEndOfBlock()

type MarketStore

type MarketStore interface {
	Upsert(ctx context.Context, market *entities.Market) error
	GetByID(ctx context.Context, marketID string) (entities.Market, error)
	GetByTxHash(ctx context.Context, txHash entities.TxHash) ([]entities.Market, error)
	GetAllPaged(ctx context.Context, marketID string, pagination entities.CursorPagination, includeSettled bool) ([]entities.Market, entities.PageInfo, error)
	ListSuccessorMarkets(ctx context.Context, marketID string, fullHistory bool, pagination entities.CursorPagination) ([]entities.SuccessorMarket, entities.PageInfo, error)
}

type Markets

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

func NewMarkets

func NewMarkets(store MarketStore) *Markets

func (*Markets) GetAllPaged

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

func (*Markets) GetByID

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

func (*Markets) GetByTxHash added in v0.71.0

func (m *Markets) GetByTxHash(ctx context.Context, txHash entities.TxHash) ([]entities.Market, error)

func (*Markets) GetMarketScalingFactor added in v0.69.0

func (m *Markets) GetMarketScalingFactor(ctx context.Context, marketID string) (num.Decimal, bool)

func (*Markets) Initialise

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

func (*Markets) ListSuccessorMarkets added in v0.72.0

func (m *Markets) ListSuccessorMarkets(ctx context.Context, marketID string, childrenOnly bool, pagination entities.CursorPagination) ([]entities.SuccessorMarket, entities.PageInfo, 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) *MultiSig

type NetworkLimits

type NetworkLimits struct{ *sqlstore.NetworkLimits }

func NewNetworkLimits

func NewNetworkLimits(store *sqlstore.NetworkLimits) *NetworkLimits

type NetworkParameter

type NetworkParameter struct{ *sqlstore.NetworkParameters }

func NewNetworkParameter

func NewNetworkParameter(store *sqlstore.NetworkParameters) *NetworkParameter

type Node

type Node struct{ *sqlstore.Node }

func NewNode

func NewNode(store *sqlstore.Node) *Node

type Notary

type Notary struct{ *sqlstore.Notary }

func NewNotary

func NewNotary(store *sqlstore.Notary) *Notary

type OracleData

type OracleData struct{ *sqlstore.OracleData }

func NewOracleData

func NewOracleData(store *sqlstore.OracleData) *OracleData

type OracleSpec

type OracleSpec struct{ *sqlstore.OracleSpec }

func NewOracleSpec

func NewOracleSpec(store *sqlstore.OracleSpec) *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) GetByMarketAndID added in v0.68.0

func (o *Order) GetByMarketAndID(ctx context.Context, marketIDstr string, orderIDs []string) ([]entities.Order, error)

func (*Order) GetByTxHash added in v0.71.0

func (o *Order) GetByTxHash(ctx context.Context, txHash entities.TxHash) ([]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 (*Order) ObserveOrders

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

type OrderStore

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

type PaidLiquidityFeesStats added in v0.73.0

type PaidLiquidityFeesStats struct {
	*sqlstore.PaidLiquidityFeesStats
}

func NewPaidLiquidityFeesStats added in v0.73.0

func NewPaidLiquidityFeesStats(store *sqlstore.PaidLiquidityFeesStats) *PaidLiquidityFeesStats

type Party

type Party struct{ *sqlstore.Parties }

func NewParty

func NewParty(store *sqlstore.Parties) *Party

type PartyActivityStreak added in v0.73.0

type PartyActivityStreak struct{ *sqlstore.PartyActivityStreaks }

func NewPartyActivityStreak added in v0.73.0

func NewPartyActivityStreak(store *sqlstore.PartyActivityStreaks) *PartyActivityStreak

type PartyLockedBalances added in v0.73.0

type PartyLockedBalances struct {
	*sqlstore.PartyLockedBalance
}

func NewPartyLockedBalances added in v0.73.0

func NewPartyLockedBalances(store *sqlstore.PartyLockedBalance) *PartyLockedBalances

type PartyVestingBalances added in v0.73.0

type PartyVestingBalances struct {
	*sqlstore.PartyVestingBalance
}

func NewPartyVestingBalances added in v0.73.0

func NewPartyVestingBalances(store *sqlstore.PartyVestingBalance) *PartyVestingBalances

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) GetByMarketAndParties added in v0.68.0

func (p *Position) GetByMarketAndParties(ctx context.Context, marketID string, partyIDs []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, partyIDs []entities.PartyID, marketIDs []entities.MarketID, pagination entities.CursorPagination) ([]entities.Position, entities.PageInfo, error)

func (*Position) GetByTxHash added in v0.71.0

func (p *Position) GetByTxHash(ctx context.Context, txHash entities.TxHash) ([]entities.Position, 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)
	GetByMarketAndParties(ctx context.Context, marketIDRaw string, partyIDsRaw []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)
	GetByTxHash(ctx context.Context, txHash entities.TxHash) ([]entities.Position, 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)
	GetByTxHash(ctx context.Context, txHash entities.TxHash) ([]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) GetByTxHash added in v0.71.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 ReferralPrograms added in v0.73.0

type ReferralPrograms struct{ *sqlstore.ReferralPrograms }

func NewReferralPrograms added in v0.73.0

func NewReferralPrograms(store *sqlstore.ReferralPrograms) *ReferralPrograms

type ReferralSets added in v0.73.0

type ReferralSets struct{ *sqlstore.ReferralSets }

func NewReferralSets added in v0.73.0

func NewReferralSets(store *sqlstore.ReferralSets) *ReferralSets

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, fromEpoch, toEpoch *uint64, p entities.CursorPagination) ([]entities.Reward, entities.PageInfo, error)

func (*Reward) GetByTxHash added in v0.71.0

func (r *Reward) GetByTxHash(ctx context.Context, txHash entities.TxHash) ([]entities.Reward, error)

func (*Reward) GetEpochRewardSummaries added in v0.65.0

func (*Reward) GetSummaries

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

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) GetByTxHash added in v0.71.0

func (r *Risk) GetByTxHash(ctx context.Context, txHash entities.TxHash) ([]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) *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) *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) *StakeLinking

type StopOrderStore added in v0.72.0

type StopOrderStore interface {
	Add(order entities.StopOrder) error
	Flush(ctx context.Context) ([]entities.StopOrder, error)
	GetStopOrder(ctx context.Context, orderID string) (entities.StopOrder, error)
	ListStopOrders(ctx context.Context, filter entities.StopOrderFilter, p entities.CursorPagination) ([]entities.StopOrder, entities.PageInfo, error)
}

type StopOrders added in v0.72.0

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

func NewStopOrders added in v0.72.0

func NewStopOrders(store StopOrderStore) *StopOrders

func (*StopOrders) Add added in v0.72.0

func (s *StopOrders) Add(order entities.StopOrder) error

func (*StopOrders) Flush added in v0.72.0

func (s *StopOrders) Flush(ctx context.Context) error

func (*StopOrders) GetStopOrder added in v0.72.0

func (s *StopOrders) GetStopOrder(ctx context.Context, orderID string) (entities.StopOrder, error)

func (*StopOrders) ListStopOrders added in v0.72.0

type Teams added in v0.73.0

type Teams struct{ *sqlstore.Teams }

func NewTeams added in v0.73.0

func NewTeams(store *sqlstore.Teams) *Teams

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) GetByTxHash added in v0.71.0

func (t *Trade) GetByTxHash(ctx context.Context, txHash entities.TxHash) ([]entities.Trade, error)

func (*Trade) GetLastTradeByMarket added in v0.71.0

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

func (*Trade) List

func (t *Trade) List(ctx context.Context,
	marketIDs []entities.MarketID,
	partyIDs []entities.PartyID,
	orderIDs []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, marketIDs []string, partyIDs []string) (<-chan []*entities.Trade, uint64)

type Transfer

type Transfer struct{ *sqlstore.Transfers }

func NewTransfer

func NewTransfer(store *sqlstore.Transfers) *Transfer

type VestingStats added in v0.73.0

type VestingStats struct{ *sqlstore.VestingStats }

func NewVestingStats added in v0.73.0

func NewVestingStats(store *sqlstore.VestingStats) *VestingStats

type VolumeDiscountPrograms added in v0.73.0

type VolumeDiscountPrograms struct {
	*sqlstore.VolumeDiscountPrograms
}

func NewVolumeDiscountPrograms added in v0.73.0

func NewVolumeDiscountPrograms(store *sqlstore.VolumeDiscountPrograms) *VolumeDiscountPrograms

type VolumeDiscountStats added in v0.73.0

type VolumeDiscountStats struct{ *sqlstore.VolumeDiscountStats }

func NewVolumeDiscountStats added in v0.73.0

func NewVolumeDiscountStats(store *sqlstore.VolumeDiscountStats) *VolumeDiscountStats

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)
	GetByTxHash(ctx context.Context, txHash entities.TxHash) ([]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) *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