events

package
v0.77.9-patch.1 Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2024 License: AGPL-3.0 Imports: 19 Imported by: 0

README

Event bus

Add a new event

  1. Create a protobuf message to describe your event in the proto folder.
  2. Register your event in BusEventType enum and BusEvent.event message in proto/events.proto.
  3. Generate the code with make proto.
  4. In events/bus.go, create a constant to identify the event and map it to the protobuf enum type BusEventType in variable protoMap and toProto. Give it a name in eventStrings.
  5. In the events folder, create a file my_event.go where the Golang definition of the new event will live:
package events

import (
	eventspb "code.vegaprotocol.io/vega/protos/vega/events/v1"
)

type MyEvent struct {
	*Base
	o eventspb.MyEvent
}

  1. Implement the StreamEvent interface on it.
  2. Implement the "FromStream interface on it.
  3. Add the support for this new event into the Service responsible for it.
  4. Update the graphql structures in the data-node in schema.graphql. In particular the BusEventType enum and the Event union

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrInvalidEventType = errors.New("invalid proto event type")

Functions

func GetMarketIDFilter

func GetMarketIDFilter(mID string) func(Event) bool

func GetPartyAndMarketFilter

func GetPartyAndMarketFilter(mID, pID string) func(Event) bool

func GetPartyIDFilter

func GetPartyIDFilter(pID string) func(Event) bool

Types

type AMMCurve added in v0.77.0

type AMMCurve struct {
	VirtualLiquidity    num.Decimal
	TheoreticalPosition num.Decimal
}

func (*AMMCurve) ToProtoEvent added in v0.77.0

func (a *AMMCurve) ToProtoEvent() *eventspb.AMM_Curve

type AMMPool added in v0.77.0

type AMMPool struct {
	*Base
	// contains filtered or unexported fields
}

func AMMPoolEventFromStream added in v0.77.0

func AMMPoolEventFromStream(ctx context.Context, be *eventspb.BusEvent) *AMMPool

func NewAMMPoolEvent added in v0.77.0

func NewAMMPoolEvent(
	ctx context.Context,
	party, market, ammParty, poolID string,
	commitment *num.Uint,
	p *types.ConcentratedLiquidityParameters,
	status types.AMMPoolStatus,
	statusReason types.AMMStatusReason,
	fees num.Decimal,
	lowerCurve *AMMCurve,
	upperCurve *AMMCurve,
) *AMMPool

func (*AMMPool) AMMPool added in v0.77.0

func (p *AMMPool) AMMPool() *eventspb.AMM

func (AMMPool) IsParty added in v0.77.0

func (p AMMPool) IsParty(id string) bool

func (AMMPool) MarketID added in v0.77.0

func (p AMMPool) MarketID() string

func (AMMPool) PartyID added in v0.77.0

func (p AMMPool) PartyID() string

func (AMMPool) Proto added in v0.77.0

func (p AMMPool) Proto() eventspb.AMM

func (AMMPool) StreamMessage added in v0.77.0

func (p AMMPool) StreamMessage() *eventspb.BusEvent

type Acc

type Acc struct {
	*Base
	// contains filtered or unexported fields
}

func AccountEventFromStream

func AccountEventFromStream(ctx context.Context, be *eventspb.BusEvent) *Acc

func NewAccountEvent

func NewAccountEvent(ctx context.Context, a types.Account) *Acc

func (*Acc) Account

func (a *Acc) Account() ptypes.Account

func (Acc) IsParty

func (a Acc) IsParty(id string) bool

func (Acc) MarketID

func (a Acc) MarketID() string

func (Acc) PartyID

func (a Acc) PartyID() string

func (Acc) Proto

func (a Acc) Proto() ptypes.Account

func (Acc) StreamMessage

func (a Acc) StreamMessage() *eventspb.BusEvent

type Asset

type Asset struct {
	*Base
	// contains filtered or unexported fields
}

func AssetEventFromStream

func AssetEventFromStream(ctx context.Context, be *eventspb.BusEvent) *Asset

func NewAssetEvent

func NewAssetEvent(ctx context.Context, a types.Asset) *Asset

func (*Asset) Asset

func (a *Asset) Asset() proto.Asset

func (Asset) Proto

func (a Asset) Proto() proto.Asset

func (Asset) StreamMessage

func (a Asset) StreamMessage() *eventspb.BusEvent

type Auction

type Auction struct {
	*Base
	// contains filtered or unexported fields
}

func AuctionEventFromStream

func AuctionEventFromStream(ctx context.Context, be *eventspb.BusEvent) *Auction

func NewAuctionEvent

func NewAuctionEvent(ctx context.Context, marketID string, leave bool, start, stop int64, triggers ...types.AuctionTrigger) *Auction

NewAuctionEvent creates a new auction event object.

func (Auction) Auction

func (a Auction) Auction() bool

Auction returns the action performed (either true=leave auction, or false=entering auction).

func (Auction) MarketEvent

func (a Auction) MarketEvent() string

MarketEvent - implement market event interface so we can log this event.

func (Auction) MarketID

func (a Auction) MarketID() string

func (Auction) Proto

func (a Auction) Proto() eventspb.AuctionEvent

Proto wrap event data in a proto message.

func (Auction) StreamMarketMessage

func (a Auction) StreamMarketMessage() *eventspb.BusEvent

StreamMarketMessage - allows for this event to be streamed as just a market event containing just market ID and a string akin to a log message.

func (Auction) StreamMessage

func (a Auction) StreamMessage() *eventspb.BusEvent

StreamMessage returns the BusEvent message for the event stream API.

type Base

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

Base common denominator all event-bus events share.

func (Base) BlockNr

func (b Base) BlockNr() int64

BlockNr returns the current block number.

func (Base) ChainID

func (b Base) ChainID() string

func (Base) CompositeCount added in v0.68.0

func (b Base) CompositeCount() uint64

CompositeCount on the base event will default to 1.

func (Base) Context

func (b Base) Context() context.Context

Context returns context.

func (*Base) Replace added in v0.74.2

func (b *Base) Replace(ctx context.Context)

Replace updates the event to be based on the new given context.

func (Base) Sequence

func (b Base) Sequence() uint64

Sequence returns event sequence number.

func (*Base) SetSequenceID

func (b *Base) SetSequenceID(s uint64)

func (Base) TraceID

func (b Base) TraceID() string

TraceID returns the... traceID obviously.

func (Base) TxHash

func (b Base) TxHash() string

func (Base) Type

func (b Base) Type() Type

Type returns the event type.

type BeginBlock added in v0.56.0

type BeginBlock struct {
	*Base
	// contains filtered or unexported fields
}

func BeginBlockEventFromStream added in v0.56.0

func BeginBlockEventFromStream(ctx context.Context, be *eventspb.BusEvent) *BeginBlock

func NewBeginBlock added in v0.56.0

func NewBeginBlock(ctx context.Context, bb eventspb.BeginBlock) *BeginBlock

NewTime returns a new time Update event.

func (BeginBlock) BeginBlock added in v0.56.0

func (b BeginBlock) BeginBlock() eventspb.BeginBlock

Time returns the new blocktime.

func (BeginBlock) Proto added in v0.56.0

func (b BeginBlock) Proto() eventspb.BeginBlock

func (BeginBlock) StreamMessage added in v0.56.0

func (b BeginBlock) StreamMessage() *eventspb.BusEvent

type CancelledOrders added in v0.76.0

type CancelledOrders struct {
	*Base
	// contains filtered or unexported fields
}

func CancelledOrdersEventFromStream added in v0.76.0

func CancelledOrdersEventFromStream(ctx context.Context, be *eventspb.BusEvent) *CancelledOrders

func NewCancelledOrdersEvent added in v0.76.0

func NewCancelledOrdersEvent(ctx context.Context, marketID, partyID string, orders ...string) *CancelledOrders

func (CancelledOrders) CompositeCount added in v0.76.0

func (c CancelledOrders) CompositeCount() uint64

func (CancelledOrders) IsMarket added in v0.76.0

func (c CancelledOrders) IsMarket(mID string) bool

func (CancelledOrders) IsParty added in v0.76.0

func (c CancelledOrders) IsParty(pID string) bool

func (CancelledOrders) MarketID added in v0.76.0

func (c CancelledOrders) MarketID() string

func (CancelledOrders) OrderIDs added in v0.76.0

func (c CancelledOrders) OrderIDs() []string

func (CancelledOrders) PartyID added in v0.76.0

func (c CancelledOrders) PartyID() string

func (CancelledOrders) Proto added in v0.76.0

func (CancelledOrders) StreamMarketMessage added in v0.76.0

func (c CancelledOrders) StreamMarketMessage() *eventspb.BusEvent

func (CancelledOrders) StreamMessage added in v0.76.0

func (c CancelledOrders) StreamMessage() *eventspb.BusEvent

type Checkpoint

type Checkpoint struct {
	*Base
	// contains filtered or unexported fields
}

func CheckpointEventFromStream

func CheckpointEventFromStream(ctx context.Context, be *eventspb.BusEvent) *Checkpoint

func NewCheckpointEvent

func NewCheckpointEvent(ctx context.Context, snap *types.CheckpointState) *Checkpoint

func (Checkpoint) Proto

func (Checkpoint) StreamMessage

func (e Checkpoint) StreamMessage() *eventspb.BusEvent

type DelegationBalance

type DelegationBalance struct {
	*Base
	Party    string
	NodeID   string
	Amount   *num.Uint
	EpochSeq string
}

func DelegationBalanceEventFromStream

func DelegationBalanceEventFromStream(ctx context.Context, be *eventspb.BusEvent) *DelegationBalance

func NewDelegationBalance

func NewDelegationBalance(ctx context.Context, party, nodeID string, amount *num.Uint, epochSeq string) *DelegationBalance

func (DelegationBalance) Proto

func (DelegationBalance) StreamMessage

func (db DelegationBalance) StreamMessage() *eventspb.BusEvent

type Deposit

type Deposit struct {
	*Base
	// contains filtered or unexported fields
}

func DepositEventFromStream

func DepositEventFromStream(ctx context.Context, be *eventspb.BusEvent) *Deposit

func NewDepositEvent

func NewDepositEvent(ctx context.Context, d types.Deposit) *Deposit

func (*Deposit) Deposit

func (d *Deposit) Deposit() proto.Deposit

func (Deposit) IsParty

func (d Deposit) IsParty(id string) bool

func (Deposit) PartyID

func (d Deposit) PartyID() string

func (Deposit) Proto

func (d Deposit) Proto() proto.Deposit

func (Deposit) StreamMessage

func (d Deposit) StreamMessage() *eventspb.BusEvent

type DistressedOrders added in v0.68.0

type DistressedOrders struct {
	*Base
	// contains filtered or unexported fields
}

DistressedOrders contains the market and parties that needed to have their orders closed in order to maintain their open positions on the market.

func DistressedOrdersEventFromStream added in v0.68.0

func DistressedOrdersEventFromStream(ctx context.Context, be *eventspb.BusEvent) *DistressedOrders

func NewDistressedOrdersEvent added in v0.68.0

func NewDistressedOrdersEvent(ctx context.Context, marketID string, parties []string) *DistressedOrders

func (DistressedOrders) IsMarket added in v0.68.0

func (d DistressedOrders) IsMarket(marketID string) bool

func (DistressedOrders) IsParty added in v0.68.0

func (d DistressedOrders) IsParty(partyID string) bool

func (DistressedOrders) MarketID added in v0.68.0

func (d DistressedOrders) MarketID() string

func (DistressedOrders) Parties added in v0.68.0

func (d DistressedOrders) Parties() []string

func (DistressedOrders) Proto added in v0.68.0

func (DistressedOrders) StreamMarketMessage added in v0.68.0

func (d DistressedOrders) StreamMarketMessage() *eventspb.BusEvent

func (DistressedOrders) StreamMessage added in v0.68.0

func (d DistressedOrders) StreamMessage() *eventspb.BusEvent

type DistressedPositions added in v0.71.0

type DistressedPositions struct {
	*Base
	// contains filtered or unexported fields
}

DistressedPositions contains the market and parties that needed to have their orders closed in order to maintain their open positions on the market.

func DistressedPositionsEventFromStream added in v0.71.0

func DistressedPositionsEventFromStream(ctx context.Context, be *eventspb.BusEvent) *DistressedPositions

func NewDistressedPositionsEvent added in v0.71.0

func NewDistressedPositionsEvent(ctx context.Context, marketID string, dParties, sParties []string) *DistressedPositions

func (*DistressedPositions) AddDistressedParties added in v0.71.0

func (d *DistressedPositions) AddDistressedParties(parties ...string)

func (*DistressedPositions) AddSafeParties added in v0.71.0

func (d *DistressedPositions) AddSafeParties(parties ...string)

func (DistressedPositions) DistressedParties added in v0.71.0

func (d DistressedPositions) DistressedParties() []string

func (DistressedPositions) IsDistressedParty added in v0.71.0

func (d DistressedPositions) IsDistressedParty(p string) bool

func (DistressedPositions) IsMarket added in v0.71.0

func (d DistressedPositions) IsMarket(marketID string) bool

func (DistressedPositions) IsParty added in v0.71.0

func (d DistressedPositions) IsParty(partyID string) bool

func (DistressedPositions) IsSafeParty added in v0.71.0

func (d DistressedPositions) IsSafeParty(p string) bool

func (DistressedPositions) MarketID added in v0.71.0

func (d DistressedPositions) MarketID() string

func (DistressedPositions) Proto added in v0.71.0

func (DistressedPositions) SafeParties added in v0.71.0

func (d DistressedPositions) SafeParties() []string

func (DistressedPositions) StreamMarketMessage added in v0.71.0

func (d DistressedPositions) StreamMarketMessage() *eventspb.BusEvent

func (DistressedPositions) StreamMessage added in v0.71.0

func (d DistressedPositions) StreamMessage() *eventspb.BusEvent

type ERC20MultiSigSigner

type ERC20MultiSigSigner struct {
	*Base
	// contains filtered or unexported fields
}

func ERC20MultiSigSignerFromStream

func ERC20MultiSigSignerFromStream(ctx context.Context, be *eventspb.BusEvent) *ERC20MultiSigSigner

func NewERC20MultiSigSigner

func NewERC20MultiSigSigner(ctx context.Context, evt types.SignerEvent) *ERC20MultiSigSigner

func (ERC20MultiSigSigner) ERC20MultiSigSigner

func (s ERC20MultiSigSigner) ERC20MultiSigSigner() eventspb.ERC20MultiSigSignerEvent

func (ERC20MultiSigSigner) Proto

func (ERC20MultiSigSigner) StreamMessage

func (s ERC20MultiSigSigner) StreamMessage() *eventspb.BusEvent

type ERC20MultiSigSignerAdded

type ERC20MultiSigSignerAdded struct {
	*Base
	// contains filtered or unexported fields
}

func ERC20MultiSigSignerAddedFromStream

func ERC20MultiSigSignerAddedFromStream(ctx context.Context, be *eventspb.BusEvent) *ERC20MultiSigSignerAdded

func (ERC20MultiSigSignerAdded) ERC20MultiSigSignerAdded

func (s ERC20MultiSigSignerAdded) ERC20MultiSigSignerAdded() eventspb.ERC20MultiSigSignerAdded

func (ERC20MultiSigSignerAdded) Proto

func (ERC20MultiSigSignerAdded) StreamMessage

func (s ERC20MultiSigSignerAdded) StreamMessage() *eventspb.BusEvent

type ERC20MultiSigSignerRemoved

type ERC20MultiSigSignerRemoved struct {
	*Base
	// contains filtered or unexported fields
}

func ERC20MultiSigSignerRemovedFromStream

func ERC20MultiSigSignerRemovedFromStream(ctx context.Context, be *eventspb.BusEvent) *ERC20MultiSigSignerRemoved

func (ERC20MultiSigSignerRemoved) ERC20MultiSigSignerRemoved

func (s ERC20MultiSigSignerRemoved) ERC20MultiSigSignerRemoved() eventspb.ERC20MultiSigSignerRemoved

func (ERC20MultiSigSignerRemoved) Proto

func (ERC20MultiSigSignerRemoved) StreamMessage

func (s ERC20MultiSigSignerRemoved) StreamMessage() *eventspb.BusEvent

type ERC20MultiSigThresholdSet

type ERC20MultiSigThresholdSet struct {
	*Base
	// contains filtered or unexported fields
}

func ERC20MultiSigThresholdSetFromStream

func ERC20MultiSigThresholdSetFromStream(ctx context.Context, be *eventspb.BusEvent) *ERC20MultiSigThresholdSet

func (ERC20MultiSigThresholdSet) ERC20MultiSigThresholdSet

func (ERC20MultiSigThresholdSet) Proto

func (ERC20MultiSigThresholdSet) StreamMessage

func (s ERC20MultiSigThresholdSet) StreamMessage() *eventspb.BusEvent

type EndBlock added in v0.56.0

type EndBlock struct {
	*Base
	// contains filtered or unexported fields
}

func EndBlockEventFromStream added in v0.56.0

func EndBlockEventFromStream(ctx context.Context, be *eventspb.BusEvent) *EndBlock

func NewEndBlock added in v0.56.0

func NewEndBlock(ctx context.Context, bb eventspb.EndBlock) *EndBlock

NewTime returns a new time Update event.

func (EndBlock) EndBlock added in v0.56.0

func (e EndBlock) EndBlock() eventspb.EndBlock

Time returns the new blocktime.

func (EndBlock) Proto added in v0.56.0

func (e EndBlock) Proto() eventspb.EndBlock

func (EndBlock) StreamMessage added in v0.56.0

func (e EndBlock) StreamMessage() *eventspb.BusEvent

type EpochEvent

type EpochEvent struct {
	*Base
	// contains filtered or unexported fields
}

func EpochEventFromStream

func EpochEventFromStream(ctx context.Context, be *eventspb.BusEvent) *EpochEvent

func NewEpochEvent

func NewEpochEvent(ctx context.Context, e *types.Epoch) *EpochEvent

func (*EpochEvent) Epoch

func (e *EpochEvent) Epoch() *eventspb.EpochEvent

func (EpochEvent) Proto

func (e EpochEvent) Proto() eventspb.EpochEvent

func (EpochEvent) StreamMessage

func (e EpochEvent) StreamMessage() *eventspb.BusEvent

type EthereumKeyRotation

type EthereumKeyRotation struct {
	*Base
	NodeID      string
	OldAddr     string
	NewAddr     string
	BlockHeight uint64
}

EthereumKeyRotation ...

func EthereumKeyRotationEventFromStream

func EthereumKeyRotationEventFromStream(ctx context.Context, be *eventspb.BusEvent) *EthereumKeyRotation

func NewEthereumKeyRotationEvent

func NewEthereumKeyRotationEvent(
	ctx context.Context,
	nodeID string,
	oldAddr string,
	newAddr string,
	blockHeight uint64,
) *EthereumKeyRotation

func (EthereumKeyRotation) EthereumKeyRotation

func (kr EthereumKeyRotation) EthereumKeyRotation() eventspb.EthereumKeyRotation

func (EthereumKeyRotation) Proto

func (EthereumKeyRotation) StreamMessage

func (kr EthereumKeyRotation) StreamMessage() *eventspb.BusEvent

type Event

type Event interface {
	Type() Type
	Context() context.Context
	TraceID() string
	TxHash() string
	ChainID() string
	Sequence() uint64
	SetSequenceID(s uint64)
	BlockNr() int64
	StreamMessage() *eventspb.BusEvent
	// used for events like ExpiredOrders. It is used to increment the sequence ID by the number of records
	// this event will produce to ensure history tables using time + sequence number to function properly.
	CompositeCount() uint64
	Replace(context.Context)
}

Event - the base event interface type, add sequence ID setter here, because the type assertions in broker seem to be a bottleneck. Change its behaviour so as to only set the sequence ID once.

type ExpiredOrders added in v0.68.0

type ExpiredOrders struct {
	*Base
	// contains filtered or unexported fields
}

ExpiredOrders contains the market and parties that needed to have their orders closed in order to maintain their open positions on the market.

func ExpiredOrdersEventFromStream added in v0.68.0

func ExpiredOrdersEventFromStream(ctx context.Context, be *eventspb.BusEvent) *ExpiredOrders

func NewExpiredOrdersEvent added in v0.68.0

func NewExpiredOrdersEvent(ctx context.Context, marketID string, orders []string) *ExpiredOrders

func (ExpiredOrders) CompositeCount added in v0.68.0

func (d ExpiredOrders) CompositeCount() uint64

func (ExpiredOrders) IsMarket added in v0.68.0

func (d ExpiredOrders) IsMarket(marketID string) bool

func (ExpiredOrders) MarketID added in v0.68.0

func (d ExpiredOrders) MarketID() string

func (ExpiredOrders) OrderIDs added in v0.68.0

func (d ExpiredOrders) OrderIDs() []string

func (ExpiredOrders) Proto added in v0.68.0

func (ExpiredOrders) StreamMarketMessage added in v0.68.0

func (d ExpiredOrders) StreamMarketMessage() *eventspb.BusEvent

func (ExpiredOrders) StreamMessage added in v0.68.0

func (d ExpiredOrders) StreamMessage() *eventspb.BusEvent

type FeesStats added in v0.73.0

type FeesStats struct {
	*Base
	// contains filtered or unexported fields
}

func FeesStatsEventFromStream added in v0.73.0

func FeesStatsEventFromStream(ctx context.Context, be *eventspb.BusEvent) *FeesStats

func NewFeesStatsEvent added in v0.73.0

func NewFeesStatsEvent(ctx context.Context, fs *eventspb.FeesStats) *FeesStats

func (*FeesStats) FeesStats added in v0.73.0

func (f *FeesStats) FeesStats() *eventspb.FeesStats

func (FeesStats) Proto added in v0.73.0

func (f FeesStats) Proto() eventspb.FeesStats

func (FeesStats) StreamMessage added in v0.73.0

func (f FeesStats) StreamMessage() *eventspb.BusEvent

type FeesTransfer

type FeesTransfer interface {
	// The list of transfers to be made by the collateral
	Transfers() []*types.Transfer
	// The total amount of fees to be paid (all cumulated)
	// per party if all the  transfers are to be executed
	// map is party id -> total amount of fees to be transferred
	TotalFeesAmountPerParty() map[string]*num.Uint
}

FeeTransfer is a transfer initiated after trade occurs.

type FundingPayments added in v0.73.0

type FundingPayments struct {
	*Base
	// contains filtered or unexported fields
}

func FundingPaymentEventFromStream added in v0.73.0

func FundingPaymentEventFromStream(ctx context.Context, be *eventspb.BusEvent) *FundingPayments

func NewFundingPaymentsEvent added in v0.73.0

func NewFundingPaymentsEvent(ctx context.Context, marketID string, seq uint64, transfers []Transfer) *FundingPayments

func (*FundingPayments) FundingPayments added in v0.73.0

func (p *FundingPayments) FundingPayments() *eventspb.FundingPayments

func (FundingPayments) IsParty added in v0.73.0

func (p FundingPayments) IsParty(id string) bool

func (FundingPayments) MarketID added in v0.73.0

func (p FundingPayments) MarketID() string

func (FundingPayments) Proto added in v0.73.0

func (FundingPayments) StreamMessage added in v0.73.0

func (p FundingPayments) StreamMessage() *eventspb.BusEvent

type FundingPeriod added in v0.73.0

type FundingPeriod struct {
	*Base
	// contains filtered or unexported fields
}

func FundingPeriodEventFromStream added in v0.73.0

func FundingPeriodEventFromStream(ctx context.Context, be *eventspb.BusEvent) *FundingPeriod

func NewFundingPeriodEvent added in v0.73.0

func NewFundingPeriodEvent(ctx context.Context, marketID string, seq uint64, start int64, end *int64, fundingPayment, fundingRate, iTWAP, eTWAP *string) *FundingPeriod

func (*FundingPeriod) FundingPeriod added in v0.73.0

func (p *FundingPeriod) FundingPeriod() *eventspb.FundingPeriod

func (FundingPeriod) Proto added in v0.73.0

func (FundingPeriod) StreamMessage added in v0.73.0

func (p FundingPeriod) StreamMessage() *eventspb.BusEvent

type FundingPeriodDataPoint added in v0.73.0

type FundingPeriodDataPoint struct {
	*Base
	// contains filtered or unexported fields
}

func FundingPeriodDataPointEventFromStream added in v0.73.0

func FundingPeriodDataPointEventFromStream(ctx context.Context, be *eventspb.BusEvent) *FundingPeriodDataPoint

func NewFundingPeriodDataPointEvent added in v0.73.0

func NewFundingPeriodDataPointEvent(ctx context.Context, marketID, mp string, t int64, seq uint64, typ eventspb.FundingPeriodDataPoint_Source, twap *num.Uint) *FundingPeriodDataPoint

func (*FundingPeriodDataPoint) FundingPeriodDataPoint added in v0.73.0

func (p *FundingPeriodDataPoint) FundingPeriodDataPoint() *eventspb.FundingPeriodDataPoint

func (FundingPeriodDataPoint) Proto added in v0.73.0

func (FundingPeriodDataPoint) StreamMessage added in v0.73.0

func (p FundingPeriodDataPoint) StreamMessage() *eventspb.BusEvent

type GameScores added in v0.77.0

type GameScores struct {
	*Base
	// contains filtered or unexported fields
}

func GameScoresEventFromStream added in v0.77.0

func GameScoresEventFromStream(ctx context.Context, be *eventspb.BusEvent) *GameScores

func NewPartyGameScoresEvent added in v0.77.0

func NewPartyGameScoresEvent(ctx context.Context, epoch int64, gameID string, time time.Time, partyScores []*types.PartyContributionScore) *GameScores

func NewTeamGameScoresEvent added in v0.77.0

func NewTeamGameScoresEvent(ctx context.Context, epoch int64, gameID string, time time.Time, teamScores []*types.PartyContributionScore, teamPartyScores map[string][]*types.PartyContributionScore) *GameScores

func (*GameScores) GameScoreEvent added in v0.77.0

func (gs *GameScores) GameScoreEvent() eventspb.GameScores

func (*GameScores) Proto added in v0.77.0

func (gs *GameScores) Proto() eventspb.GameScores

func (*GameScores) StreamMessage added in v0.77.0

func (gs *GameScores) StreamMessage() *eventspb.BusEvent

type KeyRotation

type KeyRotation struct {
	*Base
	NodeID      string
	OldPubKey   string
	NewPubKey   string
	BlockHeight uint64
}

KeyRotation ...

func KeyRotationEventFromStream

func KeyRotationEventFromStream(ctx context.Context, be *eventspb.BusEvent) *KeyRotation

func NewVegaKeyRotationEvent

func NewVegaKeyRotationEvent(
	ctx context.Context,
	nodeID string,
	oldPubKey string,
	newPubKey string,
	blockHeight uint64,
) *KeyRotation

func (KeyRotation) KeyRotation

func (kr KeyRotation) KeyRotation() eventspb.KeyRotation

func (KeyRotation) Proto

func (kr KeyRotation) Proto() eventspb.KeyRotation

func (KeyRotation) StreamMessage

func (kr KeyRotation) StreamMessage() *eventspb.BusEvent

type LedgerMovements added in v0.56.0

type LedgerMovements struct {
	*Base
	// contains filtered or unexported fields
}

func NewLedgerMovements added in v0.56.0

func NewLedgerMovements(ctx context.Context, ledgerMovements []*types.LedgerMovement) *LedgerMovements

NewLedgerMovements returns an event with transfer responses - this is the replacement of the transfer buffer.

func TransferResponseEventFromStream

func TransferResponseEventFromStream(ctx context.Context, be *eventspb.BusEvent) *LedgerMovements

func (*LedgerMovements) IsParty added in v0.56.0

func (t *LedgerMovements) IsParty(id string) bool

func (*LedgerMovements) LedgerMovements added in v0.56.0

func (t *LedgerMovements) LedgerMovements() []*ptypes.LedgerMovement

LedgerMovements returns the actual event payload.

func (*LedgerMovements) Proto added in v0.56.0

func (*LedgerMovements) StreamMessage added in v0.56.0

func (t *LedgerMovements) StreamMessage() *eventspb.BusEvent

type LiquidityProvision

type LiquidityProvision struct {
	*Base
	// contains filtered or unexported fields
}

func LiquidityProvisionEventFromStream

func LiquidityProvisionEventFromStream(ctx context.Context, be *eventspb.BusEvent) *LiquidityProvision

func (LiquidityProvision) IsParty

func (p LiquidityProvision) IsParty(id string) bool

func (LiquidityProvision) LiquidityProvision

func (p LiquidityProvision) LiquidityProvision() *proto.LiquidityProvision

func (LiquidityProvision) MarketID

func (p LiquidityProvision) MarketID() string

func (LiquidityProvision) PartyID

func (p LiquidityProvision) PartyID() string

func (LiquidityProvision) Proto

func (LiquidityProvision) StreamMessage

func (p LiquidityProvision) StreamMessage() *eventspb.BusEvent

type LossSoc

type LossSoc struct {
	*Base
	// contains filtered or unexported fields
}

func LossSocializationEventFromStream

func LossSocializationEventFromStream(ctx context.Context, be *eventspb.BusEvent) *LossSoc

func NewLossSocializationEvent

func NewLossSocializationEvent(ctx context.Context, partyID, marketID string, amount *num.Uint, neg bool, ts int64) *LossSoc

func (LossSoc) Amount

func (l LossSoc) Amount() *num.Int

func (LossSoc) IsParty

func (l LossSoc) IsParty(id string) bool

func (LossSoc) MarketID

func (l LossSoc) MarketID() string

func (LossSoc) Negative

func (l LossSoc) Negative() bool

func (LossSoc) PartyID

func (l LossSoc) PartyID() string

func (LossSoc) Proto

func (LossSoc) StreamMessage

func (l LossSoc) StreamMessage() *eventspb.BusEvent

func (LossSoc) Timestamp

func (l LossSoc) Timestamp() int64

type LossSocialization

type LossSocialization interface {
	MarketID() string
	PartyID() string
	AmountLost() int64
}

LossSocialization ...

type Margin

type Margin interface {
	MarketPosition
	Asset() string
	MarginBalance() *num.Uint
	OrderMarginBalance() *num.Uint
	GeneralBalance() *num.Uint
	BondBalance() *num.Uint
	MarketID() string
	MarginShortFall() *num.Uint
	// as opposed to the GeneralBalance() which actually returns the available balance (general+bond)
	// this returns the actual balance of the general account
	GeneralAccountBalance() *num.Uint
}

Margin is an event with a change to balances after settling e.g. MTM.

type MarginLevels

type MarginLevels struct {
	*Base
	// contains filtered or unexported fields
}

MarginLevels - the margin levels event.

func MarginLevelsEventFromStream

func MarginLevelsEventFromStream(ctx context.Context, be *eventspb.BusEvent) *MarginLevels

func NewMarginLevelsEvent

func NewMarginLevelsEvent(ctx context.Context, l types.MarginLevels) *MarginLevels

func (MarginLevels) Asset

func (m MarginLevels) Asset() string

func (MarginLevels) IsParty

func (m MarginLevels) IsParty(id string) bool

func (MarginLevels) MarginLevels

func (m MarginLevels) MarginLevels() proto.MarginLevels

func (MarginLevels) MarketID

func (m MarginLevels) MarketID() string

func (MarginLevels) PartyID

func (m MarginLevels) PartyID() string

func (MarginLevels) Proto

func (m MarginLevels) Proto() proto.MarginLevels

func (MarginLevels) StreamMessage

func (m MarginLevels) StreamMessage() *eventspb.BusEvent

type MarketCreated

type MarketCreated struct {
	*Base
	// contains filtered or unexported fields
}

func MarketCreatedEventFromStream

func MarketCreatedEventFromStream(ctx context.Context, be *eventspb.BusEvent) *MarketCreated

func NewMarketCreatedEvent

func NewMarketCreatedEvent(ctx context.Context, m types.Market) *MarketCreated

func (MarketCreated) Market

func (m MarketCreated) Market() proto.Market

func (MarketCreated) MarketEvent

func (m MarketCreated) MarketEvent() string

MarketEvent -> is needs to be logged as a market event.

func (MarketCreated) MarketID

func (m MarketCreated) MarketID() string

func (MarketCreated) MarketProto

func (m MarketCreated) MarketProto() eventspb.MarketEvent

func (MarketCreated) Proto

func (m MarketCreated) Proto() proto.Market

func (MarketCreated) StreamMarketMessage

func (m MarketCreated) StreamMarketMessage() *eventspb.BusEvent

func (MarketCreated) StreamMessage

func (m MarketCreated) StreamMessage() *eventspb.BusEvent

type MarketData

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

func MarketDataEventFromStream

func MarketDataEventFromStream(ctx context.Context, be *eventspb.BusEvent) *MarketData

func NewMarketDataEvent

func NewMarketDataEvent(ctx context.Context, md types.MarketData) *MarketData

func (MarketData) MarketData

func (m MarketData) MarketData() proto.MarketData

func (MarketData) MarketID

func (m MarketData) MarketID() string

func (MarketData) Proto

func (m MarketData) Proto() proto.MarketData

func (MarketData) StreamMessage

func (m MarketData) StreamMessage() *eventspb.BusEvent

type MarketPosition

type MarketPosition interface {
	Party() string
	Size() int64
	Buy() int64
	Sell() int64
	Price() *num.Uint
	BuySumProduct() *num.Uint
	SellSumProduct() *num.Uint
	VWBuy() *num.Uint
	VWSell() *num.Uint
	AverageEntryPrice() *num.Uint
}

MarketPosition is an event with a change to a position.

type MarketTick

type MarketTick struct {
	*Base
	// contains filtered or unexported fields
}

func MarketTickEventFromStream

func MarketTickEventFromStream(ctx context.Context, be *eventspb.BusEvent) *MarketTick

func NewMarketTick

func NewMarketTick(ctx context.Context, id string, t time.Time) *MarketTick

func (MarketTick) MarketEvent

func (m MarketTick) MarketEvent() string

func (MarketTick) MarketID

func (m MarketTick) MarketID() string

func (MarketTick) MarketProto

func (m MarketTick) MarketProto() eventspb.MarketEvent

func (MarketTick) Proto

func (m MarketTick) Proto() eventspb.MarketTick

func (MarketTick) StreamMarketMessage

func (m MarketTick) StreamMarketMessage() *eventspb.BusEvent

func (MarketTick) StreamMessage

func (m MarketTick) StreamMessage() *eventspb.BusEvent

func (MarketTick) Time

func (m MarketTick) Time() time.Time

type MarketUpdated

type MarketUpdated struct {
	*Base
	// contains filtered or unexported fields
}

func MarketUpdatedEventFromStream

func MarketUpdatedEventFromStream(ctx context.Context, be *eventspb.BusEvent) *MarketUpdated

func NewMarketUpdatedEvent

func NewMarketUpdatedEvent(ctx context.Context, m types.Market) *MarketUpdated

func (MarketUpdated) Market

func (m MarketUpdated) Market() proto.Market

func (MarketUpdated) MarketEvent

func (m MarketUpdated) MarketEvent() string

MarketEvent -> is needs to be logged as a market event.

func (MarketUpdated) MarketID

func (m MarketUpdated) MarketID() string

func (MarketUpdated) MarketProto

func (m MarketUpdated) MarketProto() eventspb.MarketEvent

func (MarketUpdated) Proto

func (m MarketUpdated) Proto() proto.Market

func (MarketUpdated) StreamMarketMessage

func (m MarketUpdated) StreamMarketMessage() *eventspb.BusEvent

func (MarketUpdated) StreamMessage

func (m MarketUpdated) StreamMessage() *eventspb.BusEvent

type NetworkLimits

type NetworkLimits struct {
	*Base
	// contains filtered or unexported fields
}

func NetworkLimitsEventFromStream

func NetworkLimitsEventFromStream(ctx context.Context, be *eventspb.BusEvent) *NetworkLimits

func NewNetworkLimitsEvent

func NewNetworkLimitsEvent(ctx context.Context, limits *proto.NetworkLimits) *NetworkLimits

func (*NetworkLimits) NetworkLimits

func (n *NetworkLimits) NetworkLimits() *proto.NetworkLimits

func (NetworkLimits) Proto

func (n NetworkLimits) Proto() *proto.NetworkLimits

func (NetworkLimits) StreamMessage

func (n NetworkLimits) StreamMessage() *eventspb.BusEvent

type NetworkParameter

type NetworkParameter struct {
	*Base
	// contains filtered or unexported fields
}

func NetworkParameterEventFromStream

func NetworkParameterEventFromStream(ctx context.Context, be *eventspb.BusEvent) *NetworkParameter

func NewNetworkParameterEvent

func NewNetworkParameterEvent(ctx context.Context, key, value string) *NetworkParameter

func (*NetworkParameter) NetworkParameter

func (n *NetworkParameter) NetworkParameter() proto.NetworkParameter

func (NetworkParameter) Proto

func (NetworkParameter) StreamMessage

func (n NetworkParameter) StreamMessage() *eventspb.BusEvent

type NodeSignature

type NodeSignature struct {
	*Base
	// contains filtered or unexported fields
}

NodeSignature ...

func NewNodeSignatureEvent

func NewNodeSignatureEvent(ctx context.Context, e commandspb.NodeSignature) *NodeSignature

func NodeSignatureEventFromStream

func NodeSignatureEventFromStream(ctx context.Context, be *eventspb.BusEvent) *NodeSignature

func (NodeSignature) NodeSignature

func (n NodeSignature) NodeSignature() commandspb.NodeSignature

func (NodeSignature) Proto

func (NodeSignature) StreamMessage

func (n NodeSignature) StreamMessage() *eventspb.BusEvent

type OracleData

type OracleData struct {
	*Base
	// contains filtered or unexported fields
}

func NewOracleDataEvent

func NewOracleDataEvent(ctx context.Context, spec vegapb.OracleData) *OracleData

func OracleDataEventFromStream

func OracleDataEventFromStream(ctx context.Context, be *eventspb.BusEvent) *OracleData

func (*OracleData) OracleData

func (o *OracleData) OracleData() vegapb.OracleData

func (OracleData) Proto

func (o OracleData) Proto() vegapb.OracleData

func (OracleData) StreamMessage

func (o OracleData) StreamMessage() *eventspb.BusEvent

type OracleSpec

type OracleSpec struct {
	*Base
	// contains filtered or unexported fields
}

func NewOracleSpecEvent

func NewOracleSpecEvent(ctx context.Context, spec *vegapb.OracleSpec) *OracleSpec

func OracleSpecEventFromStream

func OracleSpecEventFromStream(ctx context.Context, be *eventspb.BusEvent) *OracleSpec

func (*OracleSpec) OracleSpec

func (o *OracleSpec) OracleSpec() *vegapb.OracleSpec

func (OracleSpec) Proto

func (o OracleSpec) Proto() *vegapb.OracleSpec

func (OracleSpec) StreamMessage

func (o OracleSpec) StreamMessage() *eventspb.BusEvent

type Order

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

func NewOrderEvent

func NewOrderEvent(ctx context.Context, o *types.Order) *Order

func OrderEventFromStream

func OrderEventFromStream(ctx context.Context, be *eventspb.BusEvent) *Order

func (Order) IsParty

func (o Order) IsParty(id string) bool

func (Order) MarketID

func (o Order) MarketID() string

func (*Order) Order

func (o *Order) Order() *ptypes.Order

func (Order) PartyID

func (o Order) PartyID() string

func (Order) Proto

func (o Order) Proto() ptypes.Order

func (Order) StreamMessage

func (o Order) StreamMessage() *eventspb.BusEvent

type PaidLiquidityFeesStats added in v0.73.0

type PaidLiquidityFeesStats struct {
	*Base
	// contains filtered or unexported fields
}

func NewPaidLiquidityFeesStatsEvent added in v0.73.0

func NewPaidLiquidityFeesStatsEvent(ctx context.Context, fs *eventspb.PaidLiquidityFeesStats) *PaidLiquidityFeesStats

func PaidLiquidityFeesStatsEventFromStream added in v0.73.0

func PaidLiquidityFeesStatsEventFromStream(ctx context.Context, be *eventspb.BusEvent) *PaidLiquidityFeesStats

func (*PaidLiquidityFeesStats) PaidLiquidityFeesStats added in v0.73.0

func (f *PaidLiquidityFeesStats) PaidLiquidityFeesStats() *eventspb.PaidLiquidityFeesStats

func (PaidLiquidityFeesStats) Proto added in v0.73.0

func (PaidLiquidityFeesStats) StreamMessage added in v0.73.0

func (f PaidLiquidityFeesStats) StreamMessage() *eventspb.BusEvent

type Party

type Party struct {
	*Base
	// contains filtered or unexported fields
}

func NewPartyEvent

func NewPartyEvent(ctx context.Context, party types.Party) *Party

func PartyEventFromStream

func PartyEventFromStream(ctx context.Context, be *eventspb.BusEvent) *Party

func (Party) IsParty

func (p Party) IsParty(id string) bool

func (*Party) Party

func (p *Party) Party() types.Party

func (Party) Proto

func (p Party) Proto() *vegapb.Party

func (Party) StreamMessage

func (p Party) StreamMessage() *eventspb.BusEvent

type PartyActivityStreak added in v0.73.0

type PartyActivityStreak struct {
	*Base
	// contains filtered or unexported fields
}

func NewPartyActivityStreakEvent added in v0.73.0

func NewPartyActivityStreakEvent(ctx context.Context, pas *eventspb.PartyActivityStreak) *PartyActivityStreak

func PartyActivityStreakEventFromStream added in v0.73.0

func PartyActivityStreakEventFromStream(ctx context.Context, be *eventspb.BusEvent) *PartyActivityStreak

func (*PartyActivityStreak) PartyActivityStreak added in v0.73.0

func (p *PartyActivityStreak) PartyActivityStreak() *eventspb.PartyActivityStreak

func (PartyActivityStreak) Proto added in v0.73.0

func (PartyActivityStreak) StreamMessage added in v0.73.0

func (p PartyActivityStreak) StreamMessage() *eventspb.BusEvent

type PartyMarginModeUpdated added in v0.74.0

type PartyMarginModeUpdated struct {
	*Base
	// contains filtered or unexported fields
}

func NewPartyMarginModeUpdatedEvent added in v0.74.0

func NewPartyMarginModeUpdatedEvent(ctx context.Context, update *eventspb.PartyMarginModeUpdated) *PartyMarginModeUpdated

func PartyMarginModeUpdatedEventFromStream added in v0.74.0

func PartyMarginModeUpdatedEventFromStream(ctx context.Context, be *eventspb.BusEvent) *PartyMarginModeUpdated

func (*PartyMarginModeUpdated) PartyMarginModeUpdated added in v0.74.0

func (e *PartyMarginModeUpdated) PartyMarginModeUpdated() *eventspb.PartyMarginModeUpdated

func (PartyMarginModeUpdated) Proto added in v0.74.0

func (PartyMarginModeUpdated) StreamMessage added in v0.74.0

func (e PartyMarginModeUpdated) StreamMessage() *eventspb.BusEvent

type PartyProfileUpdated added in v0.74.0

type PartyProfileUpdated struct {
	*Base
	// contains filtered or unexported fields
}

func NewPartyProfileUpdatedEvent added in v0.74.0

func NewPartyProfileUpdatedEvent(ctx context.Context, p *types.PartyProfile) *PartyProfileUpdated

func PartyProfileUpdatedEventFromStream added in v0.74.0

func PartyProfileUpdatedEventFromStream(ctx context.Context, be *eventspb.BusEvent) *PartyProfileUpdated

func (PartyProfileUpdated) PartyProfileUpdated added in v0.74.0

func (t PartyProfileUpdated) PartyProfileUpdated() *eventspb.PartyProfileUpdated

func (PartyProfileUpdated) StreamMessage added in v0.74.0

func (t PartyProfileUpdated) StreamMessage() *eventspb.BusEvent

type PosRes

type PosRes struct {
	*Base
	// contains filtered or unexported fields
}

func NewPositionResolution

func NewPositionResolution(ctx context.Context, distressed, closed int, markPrice *num.Uint, marketID string) *PosRes

func PositionResolutionEventFromStream

func PositionResolutionEventFromStream(ctx context.Context, be *eventspb.BusEvent) *PosRes

func (PosRes) Closed

func (p PosRes) Closed() int

func (PosRes) Distressed

func (p PosRes) Distressed() int

func (PosRes) MarkPrice

func (p PosRes) MarkPrice() *num.Uint

func (PosRes) MarketEvent

func (p PosRes) MarketEvent() string

MarketEvent implement the MarketEvent interface.

func (PosRes) MarketID

func (p PosRes) MarketID() string

func (PosRes) MarketProto

func (p PosRes) MarketProto() eventspb.MarketEvent

func (PosRes) Proto

func (PosRes) StreamMarketMessage

func (p PosRes) StreamMarketMessage() *eventspb.BusEvent

func (PosRes) StreamMessage

func (p PosRes) StreamMessage() *eventspb.BusEvent

type PositionState

type PositionState struct {
	*Base
	// contains filtered or unexported fields
}

func NewPositionStateEvent

func NewPositionStateEvent(ctx context.Context, mp MarketPosition, marketID string) *PositionState

func PositionStateEventFromStream

func PositionStateEventFromStream(ctx context.Context, be *eventspb.BusEvent) *PositionState

func (PositionState) IsParty

func (s PositionState) IsParty(id string) bool

func (PositionState) MarketID

func (s PositionState) MarketID() string

func (PositionState) PartyID

func (s PositionState) PartyID() string

func (PositionState) PotentialBuys

func (s PositionState) PotentialBuys() int64

func (PositionState) PotentialSells

func (s PositionState) PotentialSells() int64

func (PositionState) Proto

func (PositionState) Size

func (s PositionState) Size() int64

func (PositionState) StreamMessage

func (s PositionState) StreamMessage() *eventspb.BusEvent

func (PositionState) VWBuyPrice

func (s PositionState) VWBuyPrice() *num.Uint

func (PositionState) VWSellPrice

func (s PositionState) VWSellPrice() *num.Uint

type Proposal

type Proposal struct {
	*Base
	// contains filtered or unexported fields
}

func NewProposalEvent

func NewProposalEvent(ctx context.Context, p types.Proposal) *Proposal

func NewProposalEventFromProto added in v0.74.0

func NewProposalEventFromProto(ctx context.Context, p *proto.Proposal) *Proposal

func ProposalEventFromStream

func ProposalEventFromStream(ctx context.Context, be *eventspb.BusEvent) *Proposal

func (Proposal) IsParty

func (p Proposal) IsParty(id string) bool

func (*Proposal) PartyID

func (p *Proposal) PartyID() string

PartyID - for combined subscriber, communal interface.

func (*Proposal) Proposal

func (p *Proposal) Proposal() proto.Proposal

func (*Proposal) ProposalID

func (p *Proposal) ProposalID() string

ProposalID - for combined subscriber, communal interface.

func (Proposal) Proto

func (p Proposal) Proto() proto.Proposal

func (Proposal) StreamMessage

func (p Proposal) StreamMessage() *eventspb.BusEvent

type ProtocolUpgradeDataNodeReady added in v0.65.0

type ProtocolUpgradeDataNodeReady struct {
	*Base
	// contains filtered or unexported fields
}

func NewProtocolUpgradeDataNodeReady added in v0.65.0

func NewProtocolUpgradeDataNodeReady(ctx context.Context, lastBlockHeight int64) *ProtocolUpgradeDataNodeReady

func ProtocolUpgradeDataNodeReadyEventFromStream added in v0.65.0

func ProtocolUpgradeDataNodeReadyEventFromStream(ctx context.Context, be *eventspb.BusEvent) *ProtocolUpgradeDataNodeReady

func (ProtocolUpgradeDataNodeReady) Proto added in v0.65.0

func (ProtocolUpgradeDataNodeReady) StreamMessage added in v0.65.0

func (b ProtocolUpgradeDataNodeReady) StreamMessage() *eventspb.BusEvent

type ProtocolUpgradeProposalEvent

type ProtocolUpgradeProposalEvent struct {
	*Base
	UpgradeBlockHeight uint64
	VegaReleaseTag     string
	AcceptedBy         []string
	ProposalStatus     eventspb.ProtocolUpgradeProposalStatus
}

func NewProtocolUpgradeProposalEvent

func NewProtocolUpgradeProposalEvent(ctx context.Context, upgradeBlockHeight uint64, vegaReleaseTag string, acceptedBy []string, status eventspb.ProtocolUpgradeProposalStatus) *ProtocolUpgradeProposalEvent

func ProtocolUpgradeProposalEventFromStream

func ProtocolUpgradeProposalEventFromStream(ctx context.Context, be *eventspb.BusEvent) *ProtocolUpgradeProposalEvent

func (ProtocolUpgradeProposalEvent) Proto

func (ProtocolUpgradeProposalEvent) ProtocolUpgradeProposalEvent

func (pup ProtocolUpgradeProposalEvent) ProtocolUpgradeProposalEvent() eventspb.ProtocolUpgradeEvent

func (ProtocolUpgradeProposalEvent) StreamMessage

func (pup ProtocolUpgradeProposalEvent) StreamMessage() *eventspb.BusEvent

type ProtocolUpgradeStarted added in v0.56.0

type ProtocolUpgradeStarted struct {
	*Base
	// contains filtered or unexported fields
}

func NewProtocolUpgradeStarted added in v0.56.0

func NewProtocolUpgradeStarted(ctx context.Context, bb eventspb.ProtocolUpgradeStarted) *ProtocolUpgradeStarted

NewProtocolUpgradeStarted returns a new time Update event.

func ProtocolUpgradeStartedEventFromStream added in v0.56.0

func ProtocolUpgradeStartedEventFromStream(ctx context.Context, be *eventspb.BusEvent) *ProtocolUpgradeStarted

func (ProtocolUpgradeStarted) Proto added in v0.56.0

func (ProtocolUpgradeStarted) ProtocolUpgradeStarted added in v0.56.0

func (b ProtocolUpgradeStarted) ProtocolUpgradeStarted() eventspb.ProtocolUpgradeStarted

func (ProtocolUpgradeStarted) StreamMessage added in v0.56.0

func (b ProtocolUpgradeStarted) StreamMessage() *eventspb.BusEvent

type RefereeJoinedReferralSet added in v0.73.0

type RefereeJoinedReferralSet struct {
	*Base
	// contains filtered or unexported fields
}

func NewRefereeJoinedReferralSetEvent added in v0.73.0

func NewRefereeJoinedReferralSetEvent(ctx context.Context, setID types.ReferralSetID, membership *types.Membership) *RefereeJoinedReferralSet

func RefereeJoinedReferralSetEventFromStream added in v0.73.0

func RefereeJoinedReferralSetEventFromStream(ctx context.Context, be *eventspb.BusEvent) *RefereeJoinedReferralSet

func (RefereeJoinedReferralSet) GetProtoEvent added in v0.73.0

func (RefereeJoinedReferralSet) StreamMessage added in v0.73.0

func (t RefereeJoinedReferralSet) StreamMessage() *eventspb.BusEvent

type RefereeJoinedTeam added in v0.73.0

type RefereeJoinedTeam struct {
	*Base
	// contains filtered or unexported fields
}

func NewRefereeJoinedTeamEvent added in v0.73.0

func NewRefereeJoinedTeamEvent(ctx context.Context, teamID types.TeamID, membership *types.Membership) *RefereeJoinedTeam

func RefereeJoinedTeamEventFromStream added in v0.73.0

func RefereeJoinedTeamEventFromStream(ctx context.Context, be *eventspb.BusEvent) *RefereeJoinedTeam

func (RefereeJoinedTeam) RefereeJoinedTeam added in v0.73.0

func (t RefereeJoinedTeam) RefereeJoinedTeam() *eventspb.RefereeJoinedTeam

func (RefereeJoinedTeam) StreamMessage added in v0.73.0

func (t RefereeJoinedTeam) StreamMessage() *eventspb.BusEvent

type RefereeSwitchedTeam added in v0.73.0

type RefereeSwitchedTeam struct {
	*Base
	// contains filtered or unexported fields
}

func NewRefereeSwitchedTeamEvent added in v0.73.0

func NewRefereeSwitchedTeamEvent(ctx context.Context, from, to types.TeamID, membership *types.Membership) *RefereeSwitchedTeam

func RefereeSwitchedTeamEventFromStream added in v0.73.0

func RefereeSwitchedTeamEventFromStream(ctx context.Context, be *eventspb.BusEvent) *RefereeSwitchedTeam

func (RefereeSwitchedTeam) RefereeSwitchedTeam added in v0.73.0

func (t RefereeSwitchedTeam) RefereeSwitchedTeam() *eventspb.RefereeSwitchedTeam

func (RefereeSwitchedTeam) StreamMessage added in v0.73.0

func (t RefereeSwitchedTeam) StreamMessage() *eventspb.BusEvent

type ReferralProgramEnded added in v0.73.0

type ReferralProgramEnded struct {
	*Base
	// contains filtered or unexported fields
}

func NewReferralProgramEndedEvent added in v0.73.0

func NewReferralProgramEndedEvent(ctx context.Context, version uint64, id string, epochTime time.Time, epoch uint64) *ReferralProgramEnded

func ReferralProgramEndedEventFromStream added in v0.73.0

func ReferralProgramEndedEventFromStream(ctx context.Context, be *eventspb.BusEvent) *ReferralProgramEnded

func (ReferralProgramEnded) GetReferralProgramEnded added in v0.73.0

func (t ReferralProgramEnded) GetReferralProgramEnded() *eventspb.ReferralProgramEnded

func (ReferralProgramEnded) StreamMessage added in v0.73.0

func (t ReferralProgramEnded) StreamMessage() *eventspb.BusEvent

type ReferralProgramStarted added in v0.73.0

type ReferralProgramStarted struct {
	*Base
	// contains filtered or unexported fields
}

func NewReferralProgramStartedEvent added in v0.73.0

func NewReferralProgramStartedEvent(ctx context.Context, p *types.ReferralProgram, epochTime time.Time, epoch uint64) *ReferralProgramStarted

func ReferralProgramStartedEventFromStream added in v0.73.0

func ReferralProgramStartedEventFromStream(ctx context.Context, be *eventspb.BusEvent) *ReferralProgramStarted

func (ReferralProgramStarted) GetReferralProgramStarted added in v0.73.0

func (r ReferralProgramStarted) GetReferralProgramStarted() *eventspb.ReferralProgramStarted

func (ReferralProgramStarted) StreamMessage added in v0.73.0

func (t ReferralProgramStarted) StreamMessage() *eventspb.BusEvent

type ReferralProgramUpdated added in v0.73.0

type ReferralProgramUpdated struct {
	*Base
	// contains filtered or unexported fields
}

func NewReferralProgramUpdatedEvent added in v0.73.0

func NewReferralProgramUpdatedEvent(ctx context.Context, p *types.ReferralProgram, epochTime time.Time, epoch uint64) *ReferralProgramUpdated

func ReferralProgramUpdatedEventFromStream added in v0.73.0

func ReferralProgramUpdatedEventFromStream(ctx context.Context, be *eventspb.BusEvent) *ReferralProgramUpdated

func (ReferralProgramUpdated) GetReferralProgramUpdated added in v0.73.0

func (r ReferralProgramUpdated) GetReferralProgramUpdated() *eventspb.ReferralProgramUpdated

func (ReferralProgramUpdated) StreamMessage added in v0.73.0

func (t ReferralProgramUpdated) StreamMessage() *eventspb.BusEvent

type ReferralSetCreated added in v0.73.0

type ReferralSetCreated struct {
	*Base
	// contains filtered or unexported fields
}

func NewReferralSetCreatedEvent added in v0.73.0

func NewReferralSetCreatedEvent(ctx context.Context, set *types.ReferralSet) *ReferralSetCreated

func ReferralSetCreatedEventFromStream added in v0.73.0

func ReferralSetCreatedEventFromStream(ctx context.Context, be *eventspb.BusEvent) *ReferralSetCreated

func (ReferralSetCreated) GetProtoEvent added in v0.73.0

func (t ReferralSetCreated) GetProtoEvent() *eventspb.ReferralSetCreated

func (ReferralSetCreated) StreamMessage added in v0.73.0

func (t ReferralSetCreated) StreamMessage() *eventspb.BusEvent

type ReferralSetStatsUpdated added in v0.73.0

type ReferralSetStatsUpdated struct {
	*Base
	// contains filtered or unexported fields
}

func NewReferralSetStatsUpdatedEvent added in v0.73.0

func NewReferralSetStatsUpdatedEvent(ctx context.Context, update *types.ReferralSetStats) *ReferralSetStatsUpdated

func ReferralSetStatsUpdatedEventFromStream added in v0.73.0

func ReferralSetStatsUpdatedEventFromStream(ctx context.Context, be *eventspb.BusEvent) *ReferralSetStatsUpdated

func (ReferralSetStatsUpdated) GetProtoEvent added in v0.73.0

func (ReferralSetStatsUpdated) StreamMessage added in v0.73.0

func (t ReferralSetStatsUpdated) StreamMessage() *eventspb.BusEvent

func (ReferralSetStatsUpdated) Unwrap added in v0.73.0

type RewardPayout

type RewardPayout struct {
	*Base
	Party                   string
	EpochSeq                string
	Asset                   string
	GameID                  *string
	PercentageOfTotalReward string
	Amount                  *num.Uint
	QuantumAmount           num.Decimal
	Timestamp               int64
	RewardType              types.AccountType
	LockedUntilEpoch        string
}

func NewRewardPayout

func NewRewardPayout(ctx context.Context, timestamp int64, party, epochSeq, asset string, amount *num.Uint, assetQuantum, percentageOfTotalReward num.Decimal, rewardType types.AccountType, gameID *string, lockedUntilEpoch string) *RewardPayout

func RewardPayoutEventFromStream

func RewardPayoutEventFromStream(ctx context.Context, be *eventspb.BusEvent) *RewardPayout

func (RewardPayout) Proto

func (RewardPayout) RewardPayoutEvent

func (rp RewardPayout) RewardPayoutEvent() eventspb.RewardPayoutEvent

func (RewardPayout) StreamMessage

func (rp RewardPayout) StreamMessage() *eventspb.BusEvent

type Risk

type Risk interface {
	Margin
	Amount() *num.Uint
	Transfer() *types.Transfer // I know, it's included in the Transfer interface, but this is to make it clear that this particular func is masked at this level
	MarginLevels() *types.MarginLevels
}

Risk is an event that summarizes everything and an eventual update to margin account.

type RiskFactor

type RiskFactor struct {
	*Base
	// contains filtered or unexported fields
}

func NewRiskFactorEvent

func NewRiskFactorEvent(ctx context.Context, r types.RiskFactor) *RiskFactor

func RiskFactorEventFromStream

func RiskFactorEventFromStream(ctx context.Context, be *eventspb.BusEvent) *RiskFactor

func (RiskFactor) MarketID

func (r RiskFactor) MarketID() string

func (RiskFactor) Proto

func (r RiskFactor) Proto() proto.RiskFactor

func (*RiskFactor) RiskFactor

func (r *RiskFactor) RiskFactor() proto.RiskFactor

func (RiskFactor) StreamMessage

func (r RiskFactor) StreamMessage() *eventspb.BusEvent

type SettleDistressed

type SettleDistressed struct {
	*Base
	// contains filtered or unexported fields
}

func NewSettleDistressed

func NewSettleDistressed(ctx context.Context, partyID, marketID string, price, margin *num.Uint, ts int64) *SettleDistressed

func SettleDistressedEventFromStream

func SettleDistressedEventFromStream(ctx context.Context, be *eventspb.BusEvent) *SettleDistressed

func (SettleDistressed) IsParty

func (s SettleDistressed) IsParty(id string) bool

func (SettleDistressed) Margin

func (s SettleDistressed) Margin() *num.Uint

func (SettleDistressed) MarketID

func (s SettleDistressed) MarketID() string

func (SettleDistressed) PartyID

func (s SettleDistressed) PartyID() string

func (SettleDistressed) Price

func (s SettleDistressed) Price() *num.Uint

func (SettleDistressed) Proto

func (SettleDistressed) StreamMessage

func (s SettleDistressed) StreamMessage() *eventspb.BusEvent

func (SettleDistressed) Timestamp

func (s SettleDistressed) Timestamp() int64

type SettleMarket added in v0.56.0

type SettleMarket struct {
	*Base
	// contains filtered or unexported fields
}

func NewMarketSettled added in v0.56.0

func NewMarketSettled(ctx context.Context, marketID string, ts int64, settledPrice *num.Uint, positionFactor num.Decimal) *SettleMarket

func SettleMarketEventFromStream added in v0.56.0

func SettleMarketEventFromStream(ctx context.Context, be *eventspb.BusEvent) *SettleMarket

func (SettleMarket) MarketID added in v0.56.0

func (m SettleMarket) MarketID() string

func (SettleMarket) PartyID added in v0.56.0

func (m SettleMarket) PartyID() string

PartyID will return an empty string as this is only required to satisfy an interface for identifying events that can affect positions in the data-node.

func (SettleMarket) PositionFactor added in v0.56.0

func (m SettleMarket) PositionFactor() num.Decimal

func (SettleMarket) Proto added in v0.56.0

func (m SettleMarket) Proto() *eventspb.SettleMarket

func (SettleMarket) SettledPrice added in v0.56.0

func (m SettleMarket) SettledPrice() *num.Uint

func (SettleMarket) StreamMessage added in v0.56.0

func (m SettleMarket) StreamMessage() *eventspb.BusEvent

func (SettleMarket) Timestamp added in v0.56.0

func (m SettleMarket) Timestamp() int64

type SettlePos

type SettlePos struct {
	*Base
	// contains filtered or unexported fields
}

func NewSettlePositionEvent

func NewSettlePositionEvent(ctx context.Context, partyID, marketID string, price *num.Uint, trades []TradeSettlement, ts int64, positionFactor num.Decimal) *SettlePos

func SettlePositionEventFromStream

func SettlePositionEventFromStream(ctx context.Context, be *eventspb.BusEvent) *SettlePos

func (SettlePos) IsParty

func (s SettlePos) IsParty(id string) bool

func (SettlePos) MarketID

func (s SettlePos) MarketID() string

func (SettlePos) PartyID

func (s SettlePos) PartyID() string

func (SettlePos) PositionFactor

func (s SettlePos) PositionFactor() num.Decimal

func (SettlePos) Price

func (s SettlePos) Price() *num.Uint

func (SettlePos) Proto

func (s SettlePos) Proto() eventspb.SettlePosition

func (SettlePos) StreamMessage

func (s SettlePos) StreamMessage() *eventspb.BusEvent

func (SettlePos) Timestamp

func (s SettlePos) Timestamp() int64

func (SettlePos) Trades

func (s SettlePos) Trades() []TradeSettlement

type SettlePosition

type SettlePosition interface {
	MarketID() string
	Trades() []TradeSettlement
	Margin() (uint64, bool)
	Party() string
	Price() uint64
}

SettlePosition is an event that the settlement buffer will propagate through the system used by the plugins (currently only the positions API).

type SnapshotTakenEvent added in v0.65.0

type SnapshotTakenEvent struct {
	*Base
	SnapshotBlockHeight  uint64
	SnapshotBlockHash    string
	VegaCoreVersion      string
	ProtocolUpgradeBlock bool
}

func NewSnapshotEventEvent added in v0.65.0

func NewSnapshotEventEvent(ctx context.Context, blockHeight uint64, blockHash string, protocolUpgradeBlock bool) *SnapshotTakenEvent

func SnapthostTakenEventFromStream added in v0.65.0

func SnapthostTakenEventFromStream(ctx context.Context, be *eventspb.BusEvent) *SnapshotTakenEvent

func (SnapshotTakenEvent) Proto added in v0.65.0

func (SnapshotTakenEvent) SnapshotTakenEvent added in v0.65.0

func (ste SnapshotTakenEvent) SnapshotTakenEvent() eventspb.CoreSnapshotData

func (SnapshotTakenEvent) StreamMessage added in v0.65.0

func (ste SnapshotTakenEvent) StreamMessage() *eventspb.BusEvent

type StakeLinking

type StakeLinking struct {
	*Base
	// contains filtered or unexported fields
}

func NewStakeLinking

func NewStakeLinking(ctx context.Context, evt types.StakeLinking) *StakeLinking

func StakeLinkingFromStream

func StakeLinkingFromStream(ctx context.Context, be *eventspb.BusEvent) *StakeLinking

func (StakeLinking) Proto

func (StakeLinking) StakeLinking

func (s StakeLinking) StakeLinking() eventspb.StakeLinking

func (StakeLinking) StreamMessage

func (s StakeLinking) StreamMessage() *eventspb.BusEvent

type StateVar

type StateVar struct {
	*Base
	ID      string
	EventID string
	State   string
}

StateVar is an event for tracking consensus in floating point state variables.

func NewStateVarEvent

func NewStateVarEvent(ctx context.Context, ID, eventID, state string) *StateVar

func StateVarEventFromStream

func StateVarEventFromStream(ctx context.Context, be *eventspb.BusEvent) *StateVar

func (StateVar) Proto

func (sv StateVar) Proto() eventspb.StateVar

func (StateVar) StreamMessage

func (sv StateVar) StreamMessage() *eventspb.BusEvent

type StopOrder added in v0.72.0

type StopOrder struct {
	*Base
	// contains filtered or unexported fields
}

func NewStopOrderEvent added in v0.72.0

func NewStopOrderEvent(ctx context.Context, so *types.StopOrder) *StopOrder

func StopOrderEventFromStream added in v0.72.0

func StopOrderEventFromStream(ctx context.Context, be *eventspb.BusEvent) *StopOrder

func (StopOrder) StopOrder added in v0.72.0

func (o StopOrder) StopOrder() *eventspb.StopOrderEvent

func (StopOrder) StreamMessage added in v0.72.0

func (o StopOrder) StreamMessage() *eventspb.BusEvent

type TeamCreated added in v0.73.0

type TeamCreated struct {
	*Base
	// contains filtered or unexported fields
}

func NewTeamCreatedEvent added in v0.73.0

func NewTeamCreatedEvent(ctx context.Context, epoch uint64, t *types.Team) *TeamCreated

func TeamCreatedEventFromStream added in v0.73.0

func TeamCreatedEventFromStream(ctx context.Context, be *eventspb.BusEvent) *TeamCreated

func (TeamCreated) StreamMessage added in v0.73.0

func (t TeamCreated) StreamMessage() *eventspb.BusEvent

func (TeamCreated) TeamCreated added in v0.73.0

func (t TeamCreated) TeamCreated() *eventspb.TeamCreated

type TeamUpdated added in v0.73.0

type TeamUpdated struct {
	*Base
	// contains filtered or unexported fields
}

func NewTeamUpdatedEvent added in v0.73.0

func NewTeamUpdatedEvent(ctx context.Context, t *types.Team) *TeamUpdated

func TeamUpdatedEventFromStream added in v0.73.0

func TeamUpdatedEventFromStream(ctx context.Context, be *eventspb.BusEvent) *TeamUpdated

func (TeamUpdated) StreamMessage added in v0.73.0

func (t TeamUpdated) StreamMessage() *eventspb.BusEvent

func (TeamUpdated) TeamUpdated added in v0.73.0

func (t TeamUpdated) TeamUpdated() *eventspb.TeamUpdated

type TeamsStatsUpdated added in v0.74.0

type TeamsStatsUpdated struct {
	*Base
	// contains filtered or unexported fields
}

func NewTeamsStatsUpdatedEvent added in v0.74.0

func NewTeamsStatsUpdatedEvent(ctx context.Context, seq uint64, rawTeamsStats map[string]map[string]*num.Uint) *TeamsStatsUpdated

func TeamsStatsUpdatedEventFromStream added in v0.74.0

func TeamsStatsUpdatedEventFromStream(ctx context.Context, be *eventspb.BusEvent) *TeamsStatsUpdated

func (TeamsStatsUpdated) StreamMessage added in v0.74.0

func (t TeamsStatsUpdated) StreamMessage() *eventspb.BusEvent

func (TeamsStatsUpdated) TeamsStatsUpdated added in v0.74.0

func (t TeamsStatsUpdated) TeamsStatsUpdated() *eventspb.TeamsStatsUpdated

type Time

type Time struct {
	*Base
	// contains filtered or unexported fields
}

Time event indicating a change in block time (ie time update).

func NewTime

func NewTime(ctx context.Context, t time.Time) *Time

NewTime returns a new time Update event.

func TimeEventFromStream

func TimeEventFromStream(ctx context.Context, be *eventspb.BusEvent) *Time

func (Time) Proto

func (t Time) Proto() eventspb.TimeUpdate

func (Time) StreamMessage

func (t Time) StreamMessage() *eventspb.BusEvent

func (Time) Time

func (t Time) Time() time.Time

Time returns the new blocktime.

type TimeWeightedNotionalPositionUpdated added in v0.75.0

type TimeWeightedNotionalPositionUpdated struct {
	*Base
	// contains filtered or unexported fields
}

func NewTimeWeightedNotionalPositionUpdated added in v0.75.0

func NewTimeWeightedNotionalPositionUpdated(ctx context.Context, epochSeq uint64, asset, party, gameID, notionalPosition string) *TimeWeightedNotionalPositionUpdated

func TimeWeightedNotionalPositionUpdatedEventFromStream added in v0.75.0

func TimeWeightedNotionalPositionUpdatedEventFromStream(ctx context.Context, be *eventspb.BusEvent) *TimeWeightedNotionalPositionUpdated

func (*TimeWeightedNotionalPositionUpdated) StreamMessage added in v0.75.0

func (*TimeWeightedNotionalPositionUpdated) TimeWeightedNotionalPositionUpdated added in v0.75.0

func (tw *TimeWeightedNotionalPositionUpdated) TimeWeightedNotionalPositionUpdated() *eventspb.TimeWeightedNotionalPositionUpdated

type Trade

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

func NewTradeEvent

func NewTradeEvent(ctx context.Context, t types.Trade) *Trade

func TradeEventFromStream

func TradeEventFromStream(ctx context.Context, be *eventspb.BusEvent) *Trade

func (Trade) IsParty

func (t Trade) IsParty(id string) bool

func (Trade) MarketID

func (t Trade) MarketID() string

func (Trade) Proto

func (t Trade) Proto() ptypes.Trade

func (Trade) StreamMessage

func (t Trade) StreamMessage() *eventspb.BusEvent

func (*Trade) Trade

func (t *Trade) Trade() ptypes.Trade

type TradeSettlement

type TradeSettlement interface {
	Size() int64
	Price() *num.Uint
	MarketPrice() *num.Uint
}

TradeSettlement Part of the SettlePosition interface -> traces trades as they happened.

type TransactionResult added in v0.58.0

type TransactionResult struct {
	*Base
	// contains filtered or unexported fields
}

func NewTransactionResultEventFailure added in v0.58.0

func NewTransactionResultEventFailure(
	ctx context.Context,
	hash, party string,
	err error,
	tx interface{},
) *TransactionResult

func NewTransactionResultEventSuccess added in v0.58.0

func NewTransactionResultEventSuccess(
	ctx context.Context,
	hash, party string,
	tx interface{},
) *TransactionResult

func TransactionResultEventFromStream added in v0.58.0

func TransactionResultEventFromStream(ctx context.Context, be *eventspb.BusEvent) *TransactionResult

func (*TransactionResult) Hash added in v0.74.0

func (tr *TransactionResult) Hash() string

func (TransactionResult) IsParty added in v0.58.0

func (t TransactionResult) IsParty(id string) bool

func (*TransactionResult) PartyID added in v0.74.0

func (tr *TransactionResult) PartyID() string

func (TransactionResult) Proto added in v0.58.0

func (*TransactionResult) Status added in v0.74.0

func (tr *TransactionResult) Status() bool

func (TransactionResult) StreamMessage added in v0.58.0

func (t TransactionResult) StreamMessage() *eventspb.BusEvent

func (TransactionResult) TransactionResult added in v0.74.0

func (t TransactionResult) TransactionResult() TransactionResult

type Transfer

type Transfer interface {
	MarketPosition
	Transfer() *types.Transfer
}

Transfer is an event passed on by settlement engine, contains position and the resulting transfer for the collateral engine to use. We need MarketPosition because we can't loose the long/short status of the open positions.

type TransferFees added in v0.73.0

type TransferFees struct {
	*Base
	// contains filtered or unexported fields
}

TransferFees ...

func NewTransferFeesEvent added in v0.73.0

func NewTransferFeesEvent(ctx context.Context, transferID string, amount *num.Uint, discount *num.Uint, epoch uint64) *TransferFees

func TransferFeesEventFromStream added in v0.73.0

func TransferFeesEventFromStream(ctx context.Context, be *eventspb.BusEvent) *TransferFees

func (TransferFees) Proto added in v0.73.0

func (TransferFees) StreamMessage added in v0.73.0

func (t TransferFees) StreamMessage() *eventspb.BusEvent

func (TransferFees) TransferFees added in v0.73.0

func (t TransferFees) TransferFees() eventspb.TransferFees

type TransferFeesDiscountUpdated added in v0.74.0

type TransferFeesDiscountUpdated struct {
	*Base
	// contains filtered or unexported fields
}

TransferFeesDiscountUpdated ...

func NewTransferFeesDiscountUpdated added in v0.74.0

func NewTransferFeesDiscountUpdated(ctx context.Context, party, asset string, amount *num.Uint, epoch uint64) *TransferFeesDiscountUpdated

func TransferFeesDiscountUpdatedFromStream added in v0.74.0

func TransferFeesDiscountUpdatedFromStream(ctx context.Context, be *eventspb.BusEvent) *TransferFeesDiscountUpdated

func (TransferFeesDiscountUpdated) Proto added in v0.74.0

func (TransferFeesDiscountUpdated) StreamMessage added in v0.74.0

func (t TransferFeesDiscountUpdated) StreamMessage() *eventspb.BusEvent

func (TransferFeesDiscountUpdated) TransferFeesDiscount added in v0.74.0

type TransferFunds

type TransferFunds struct {
	*Base
	// contains filtered or unexported fields
}

func NewGovTransferFundsEvent added in v0.72.0

func NewGovTransferFundsEvent(
	ctx context.Context,
	t *types.GovernanceTransfer,
	amount *num.Uint,
	gameID *string,
) *TransferFunds

func NewGovTransferFundsEventWithReason added in v0.72.0

func NewGovTransferFundsEventWithReason(
	ctx context.Context,
	t *types.GovernanceTransfer,
	amount *num.Uint,
	reason string,
	gameID *string,
) *TransferFunds

func NewOneOffTransferFundsEvent

func NewOneOffTransferFundsEvent(
	ctx context.Context,
	t *types.OneOffTransfer,
) *TransferFunds

func NewOneOffTransferFundsEventWithReason added in v0.59.0

func NewOneOffTransferFundsEventWithReason(
	ctx context.Context,
	t *types.OneOffTransfer,
	reason string,
) *TransferFunds

func NewRecurringTransferFundsEvent

func NewRecurringTransferFundsEvent(
	ctx context.Context,
	t *types.RecurringTransfer,
	gameID *string,
) *TransferFunds

func NewRecurringTransferFundsEventWithReason added in v0.59.0

func NewRecurringTransferFundsEventWithReason(
	ctx context.Context,
	t *types.RecurringTransfer,
	reason string,
	gameID *string,
) *TransferFunds

func TransferFundsEventFromStream

func TransferFundsEventFromStream(ctx context.Context, be *eventspb.BusEvent) *TransferFunds

func (TransferFunds) PartyID

func (t TransferFunds) PartyID() string

func (TransferFunds) Proto

func (t TransferFunds) Proto() eventspb.Transfer

func (TransferFunds) StreamMessage

func (t TransferFunds) StreamMessage() *eventspb.BusEvent

func (TransferFunds) TransferFunds

func (t TransferFunds) TransferFunds() eventspb.Transfer

type TxErr

type TxErr struct {
	*Base
	// contains filtered or unexported fields
}

func NewTxErrEvent

func NewTxErrEvent(ctx context.Context, err error, partyID string, tx interface{}, cmd string) *TxErr

func TxErrEventFromStream

func TxErrEventFromStream(ctx context.Context, be *eventspb.BusEvent) *TxErr

func (TxErr) IsParty

func (t TxErr) IsParty(id string) bool

func (TxErr) Proto

func (t TxErr) Proto() eventspb.TxErrorEvent

func (TxErr) StreamMessage

func (t TxErr) StreamMessage() *eventspb.BusEvent

type Type

type Type int
const (
	// All event type -> used by subscribers to just receive all events, has no actual corresponding event payload.
	All Type = iota
	// other event types that DO have corresponding event types.
	TimeUpdate
	LedgerMovementsEvent
	PositionResolution
	MarketEvent // this event is not used for any specific event, but by subscribers that aggregate all market events (e.g. for logging)
	OrderEvent
	LiquidityProvisionEvent
	AccountEvent
	PartyEvent
	TradeEvent
	MarginLevelsEvent
	ProposalEvent
	VoteEvent
	MarketDataEvent
	NodeSignatureEvent
	LossSocializationEvent
	SettlePositionEvent
	SettleDistressedEvent
	MarketCreatedEvent
	MarketUpdatedEvent
	AssetEvent
	MarketTickEvent
	AuctionEvent
	WithdrawalEvent
	DepositEvent
	RiskFactorEvent
	NetworkParameterEvent
	TxErrEvent
	OracleSpecEvent
	OracleDataEvent
	EpochUpdate
	DelegationBalanceEvent
	StakeLinkingEvent
	ValidatorUpdateEvent
	RewardPayoutEvent
	CheckpointEvent
	ValidatorScoreEvent
	KeyRotationEvent
	StateVarEvent
	NetworkLimitsEvent
	TransferEvent
	ValidatorRankingEvent
	ERC20MultiSigThresholdSetEvent
	ERC20MultiSigSignerEvent
	ERC20MultiSigSignerAddedEvent
	ERC20MultiSigSignerRemovedEvent
	PositionStateEvent
	EthereumKeyRotationEvent
	ProtocolUpgradeEvent
	BeginBlockEvent
	EndBlockEvent
	ProtocolUpgradeStartedEvent
	SettleMarketEvent
	TransactionResultEvent
	CoreSnapshotEvent
	ProtocolUpgradeDataNodeReadyEvent
	DistressedOrdersClosedEvent
	ExpiredOrdersEvent
	DistressedPositionsEvent
	SpotLiquidityProvisionEvent
	StopOrderEvent
	FundingPeriodEvent
	FundingPeriodDataPointEvent
	TeamCreatedEvent
	TeamUpdatedEvent
	RefereeSwitchedTeamEvent
	RefereeJoinedTeamEvent
	ReferralProgramStartedEvent
	ReferralProgramEndedEvent
	ReferralProgramUpdatedEvent
	ReferralSetCreatedEvent
	RefereeJoinedReferralSetEvent
	PartyActivityStreakEvent
	VolumeDiscountProgramStartedEvent
	VolumeDiscountProgramEndedEvent
	VolumeDiscountProgramUpdatedEvent
	ReferralSetStatsUpdatedEvent
	VestingStatsUpdatedEvent
	VolumeDiscountStatsUpdatedEvent
	FeesStatsEvent
	FundingPaymentsEvent
	PaidLiquidityFeesStatsEvent
	VestingBalancesSummaryEvent
	TransferFeesEvent
	TransferFeesDiscountUpdatedEvent
	PartyMarginModeUpdatedEvent
	PartyProfileUpdatedEvent
	TeamsStatsUpdatedEvent
	TimeWeightedNotionalPositionUpdatedEvent
	CancelledOrdersEvent
	GameScoresEvent
	AMMPoolEvent
)

func MarketEvents

func MarketEvents() []Type

MarketEvents return all the possible market events.

func ProtoToInternal

func ProtoToInternal(pTypes ...eventspb.BusEventType) ([]Type, error)

ProtoToInternal converts the proto message enum to our internal constants we're not using a map to de-duplicate the event types here, so we can exploit duplicating the same event to control the internal subscriber channel buffer.

func TryFromString

func TryFromString(s string) (*Type, bool)

TryFromString tries to parse a raw string into an event type, false indicates that.

func (Type) String

func (t Type) String() string

String get string representation of event type.

func (Type) ToProto

func (t Type) ToProto() eventspb.BusEventType

type ValidatorRanking

type ValidatorRanking struct {
	*Base
	NodeID           string
	EpochSeq         string
	StakeScore       string
	PerformanceScore string
	Ranking          string
	PreviousStatus   string
	Status           string
	TMVotingPower    int
}

func NewValidatorRanking

func NewValidatorRanking(ctx context.Context, epochSeq, nodeID, stakeScore, performanceScore, ranking, previousStatus, status string, votingPower int) *ValidatorRanking

func ValidatorRankingEventFromStream

func ValidatorRankingEventFromStream(ctx context.Context, be *eventspb.BusEvent) *ValidatorRanking

func (ValidatorRanking) Proto

func (ValidatorRanking) StreamMessage

func (vr ValidatorRanking) StreamMessage() *eventspb.BusEvent

func (ValidatorRanking) ValidatorRankingEvent

func (vr ValidatorRanking) ValidatorRankingEvent() eventspb.ValidatorRankingEvent

type ValidatorScore

type ValidatorScore struct {
	*Base
	NodeID               string
	EpochSeq             string
	ValidatorScore       string
	NormalisedScore      string
	RawValidatorScore    string
	ValidatorPerformance string
	MultisigScore        string
	ValidatorStatus      string
}

func NewValidatorScore

func NewValidatorScore(ctx context.Context, nodeID, epochSeq string, score, normalisedScore, rawValidatorScore,
	validatorPerformance num.Decimal, multisigScore num.Decimal, validatorStatus string,
) *ValidatorScore

func ValidatorScoreEventFromStream

func ValidatorScoreEventFromStream(ctx context.Context, be *eventspb.BusEvent) *ValidatorScore

func (ValidatorScore) Proto

func (ValidatorScore) StreamMessage

func (vd ValidatorScore) StreamMessage() *eventspb.BusEvent

func (ValidatorScore) ValidatorScoreEvent

func (vd ValidatorScore) ValidatorScoreEvent() eventspb.ValidatorScoreEvent

type ValidatorUpdate

type ValidatorUpdate struct {
	*Base
	// contains filtered or unexported fields
}

ValidatorUpdate ...

func NewValidatorUpdateEvent

func NewValidatorUpdateEvent(
	ctx context.Context,
	nodeID string,
	vegaPubKey string,
	vegaPubKeyIndex uint32,
	ethAddress string,
	tmPubKey string,
	infoURL string,
	country string,
	name string,
	avatarURL string,
	fromEpoch uint64,
	added bool,
	epochSeq uint64,
) *ValidatorUpdate

func ValidatorUpdateEventFromStream

func ValidatorUpdateEventFromStream(ctx context.Context, be *eventspb.BusEvent) *ValidatorUpdate

func (ValidatorUpdate) AvatarURL

func (vu ValidatorUpdate) AvatarURL() string

AvatarURL return an URL to the validator avatar for UI purpose.

func (ValidatorUpdate) Country

func (vu ValidatorUpdate) Country() string

Country returns country code of node's location.

func (ValidatorUpdate) EthereumAddress

func (vu ValidatorUpdate) EthereumAddress() string

EthereumAddress returns validator's ethereum address.

func (ValidatorUpdate) InfoURL

func (vu ValidatorUpdate) InfoURL() string

InfoURL returns an url with information about validator node.

func (ValidatorUpdate) Name

func (vu ValidatorUpdate) Name() string

Name return the name of the validator.

func (ValidatorUpdate) NodeID

func (vu ValidatorUpdate) NodeID() string

NodeID returns nodes ID.

func (ValidatorUpdate) Proto

func (ValidatorUpdate) StreamMessage

func (vu ValidatorUpdate) StreamMessage() *eventspb.BusEvent

func (ValidatorUpdate) TendermintPublicKey

func (vu ValidatorUpdate) TendermintPublicKey() string

TendermintPublicKey returns Tendermint nodes public key.

func (ValidatorUpdate) ValidatorUpdate

func (vu ValidatorUpdate) ValidatorUpdate() eventspb.ValidatorUpdate

func (ValidatorUpdate) VegaPublicKey

func (vu ValidatorUpdate) VegaPublicKey() string

VegaPublicKey returns validator's vega public key.

func (ValidatorUpdate) VegaPublicKeyIndex

func (vu ValidatorUpdate) VegaPublicKeyIndex() uint32

VegaPublicKey returns validator's vega public key index.

type VestingBalancesSummary added in v0.73.0

type VestingBalancesSummary struct {
	*Base
	// contains filtered or unexported fields
}

func NewVestingBalancesSummaryEvent added in v0.73.0

func NewVestingBalancesSummaryEvent(ctx context.Context, vbs *eventspb.VestingBalancesSummary) *VestingBalancesSummary

func VestingBalancesSummaryEventFromStream added in v0.73.0

func VestingBalancesSummaryEventFromStream(ctx context.Context, be *eventspb.BusEvent) *VestingBalancesSummary

func (VestingBalancesSummary) Proto added in v0.73.0

func (VestingBalancesSummary) StreamMessage added in v0.73.0

func (v VestingBalancesSummary) StreamMessage() *eventspb.BusEvent

func (*VestingBalancesSummary) VestingBalancesSummary added in v0.73.0

func (v *VestingBalancesSummary) VestingBalancesSummary() *eventspb.VestingBalancesSummary

type VestingStatsUpdated added in v0.73.0

type VestingStatsUpdated struct {
	*Base
	// contains filtered or unexported fields
}

func NewVestingStatsUpdatedEvent added in v0.73.0

func NewVestingStatsUpdatedEvent(ctx context.Context, vsu *eventspb.VestingStatsUpdated) *VestingStatsUpdated

func VestingStatsUpdatedEventFromStream added in v0.73.0

func VestingStatsUpdatedEventFromStream(ctx context.Context, be *eventspb.BusEvent) *VestingStatsUpdated

func (VestingStatsUpdated) Proto added in v0.73.0

func (VestingStatsUpdated) StreamMessage added in v0.73.0

func (p VestingStatsUpdated) StreamMessage() *eventspb.BusEvent

func (*VestingStatsUpdated) VestingStatsUpdated added in v0.73.0

func (p *VestingStatsUpdated) VestingStatsUpdated() *eventspb.VestingStatsUpdated

type VolumeDiscountProgramEnded added in v0.73.0

type VolumeDiscountProgramEnded struct {
	*Base
	// contains filtered or unexported fields
}

func NewVolumeDiscountProgramEndedEvent added in v0.73.0

func NewVolumeDiscountProgramEndedEvent(ctx context.Context, version uint64, id string, epochTime time.Time, epoch uint64) *VolumeDiscountProgramEnded

func VolumeDiscountProgramEndedEventFromStream added in v0.73.0

func VolumeDiscountProgramEndedEventFromStream(ctx context.Context, be *eventspb.BusEvent) *VolumeDiscountProgramEnded

func (*VolumeDiscountProgramEnded) GetVolumeDiscountProgramEnded added in v0.73.0

func (v *VolumeDiscountProgramEnded) GetVolumeDiscountProgramEnded() *eventspb.VolumeDiscountProgramEnded

func (*VolumeDiscountProgramEnded) StreamMessage added in v0.73.0

func (t *VolumeDiscountProgramEnded) StreamMessage() *eventspb.BusEvent

type VolumeDiscountProgramStarted added in v0.73.0

type VolumeDiscountProgramStarted struct {
	*Base
	// contains filtered or unexported fields
}

func NewVolumeDiscountProgramStartedEvent added in v0.73.0

func NewVolumeDiscountProgramStartedEvent(ctx context.Context, p *types.VolumeDiscountProgram, epochTime time.Time, epoch uint64) *VolumeDiscountProgramStarted

func VolumeDiscountProgramStartedEventFromStream added in v0.73.0

func VolumeDiscountProgramStartedEventFromStream(ctx context.Context, be *eventspb.BusEvent) *VolumeDiscountProgramStarted

func (*VolumeDiscountProgramStarted) GetVolumeDiscountProgramStarted added in v0.73.0

func (v *VolumeDiscountProgramStarted) GetVolumeDiscountProgramStarted() *eventspb.VolumeDiscountProgramStarted

func (*VolumeDiscountProgramStarted) StreamMessage added in v0.73.0

func (t *VolumeDiscountProgramStarted) StreamMessage() *eventspb.BusEvent

type VolumeDiscountProgramUpdated added in v0.73.0

type VolumeDiscountProgramUpdated struct {
	*Base
	// contains filtered or unexported fields
}

func NewVolumeDiscountProgramUpdatedEvent added in v0.73.0

func NewVolumeDiscountProgramUpdatedEvent(ctx context.Context, p *types.VolumeDiscountProgram, epochTime time.Time, epoch uint64) *VolumeDiscountProgramUpdated

func VolumeDiscountProgramUpdatedEventFromStream added in v0.73.0

func VolumeDiscountProgramUpdatedEventFromStream(ctx context.Context, be *eventspb.BusEvent) *VolumeDiscountProgramUpdated

func (*VolumeDiscountProgramUpdated) GetVolumeDiscountProgramUpdated added in v0.73.0

func (v *VolumeDiscountProgramUpdated) GetVolumeDiscountProgramUpdated() *eventspb.VolumeDiscountProgramUpdated

func (*VolumeDiscountProgramUpdated) StreamMessage added in v0.73.0

func (t *VolumeDiscountProgramUpdated) StreamMessage() *eventspb.BusEvent

type VolumeDiscountStatsUpdated added in v0.73.0

type VolumeDiscountStatsUpdated struct {
	*Base
	// contains filtered or unexported fields
}

func NewVolumeDiscountStatsUpdatedEvent added in v0.73.0

func NewVolumeDiscountStatsUpdatedEvent(ctx context.Context, vdsu *eventspb.VolumeDiscountStatsUpdated) *VolumeDiscountStatsUpdated

func VolumeDiscountStatsUpdatedEventFromStream added in v0.73.0

func VolumeDiscountStatsUpdatedEventFromStream(ctx context.Context, be *eventspb.BusEvent) *VolumeDiscountStatsUpdated

func (VolumeDiscountStatsUpdated) Proto added in v0.73.0

func (VolumeDiscountStatsUpdated) StreamMessage added in v0.73.0

func (p VolumeDiscountStatsUpdated) StreamMessage() *eventspb.BusEvent

func (*VolumeDiscountStatsUpdated) VolumeDiscountStatsUpdated added in v0.73.0

func (p *VolumeDiscountStatsUpdated) VolumeDiscountStatsUpdated() *eventspb.VolumeDiscountStatsUpdated

type Vote

type Vote struct {
	*Base
	// contains filtered or unexported fields
}

func NewVoteEvent

func NewVoteEvent(ctx context.Context, v types.Vote) *Vote

func VoteEventFromStream

func VoteEventFromStream(ctx context.Context, be *eventspb.BusEvent) *Vote

func (Vote) IsParty

func (v Vote) IsParty(id string) bool

IsParty - used in event stream API filter.

func (*Vote) PartyID

func (v *Vote) PartyID() string

PartyID - return the PartyID for subscribers' convenience.

func (*Vote) ProposalID

func (v *Vote) ProposalID() string

ProposalID get the proposal ID, part of the interface for event subscribers.

func (Vote) Proto

func (v Vote) Proto() proto.Vote

func (Vote) StreamMessage

func (v Vote) StreamMessage() *eventspb.BusEvent

func (*Vote) TotalGovernanceTokenBalance

func (v *Vote) TotalGovernanceTokenBalance() string

TotalGovernanceTokenBalance returns the total balance of token used for this vote.

func (*Vote) TotalGovernanceTokenWeight

func (v *Vote) TotalGovernanceTokenWeight() string

TotalGovernanceTokenWeight returns the total weight of token used for this vote.

func (*Vote) Value

func (v *Vote) Value() proto.Vote_Value

Value - return a Y/N value, makes subscribers easier to implement.

func (*Vote) Vote

func (v *Vote) Vote() proto.Vote

Vote get the vote object.

type Withdrawal

type Withdrawal struct {
	*Base
	// contains filtered or unexported fields
}

func NewWithdrawalEvent

func NewWithdrawalEvent(ctx context.Context, w types.Withdrawal) *Withdrawal

func WithdrawalEventFromStream

func WithdrawalEventFromStream(ctx context.Context, be *eventspb.BusEvent) *Withdrawal

func (Withdrawal) IsParty

func (w Withdrawal) IsParty(id string) bool

func (Withdrawal) PartyID

func (w Withdrawal) PartyID() string

func (Withdrawal) Proto

func (w Withdrawal) Proto() proto.Withdrawal

func (Withdrawal) StreamMessage

func (w Withdrawal) StreamMessage() *eventspb.BusEvent

func (*Withdrawal) Withdrawal

func (w *Withdrawal) Withdrawal() proto.Withdrawal

Jump to

Keyboard shortcuts

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