events

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: May 2, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AccountCreatedSubscription added in v0.1.19

type AccountCreatedSubscription struct {
	NewAccountChan chan *models.Account
	// contains filtered or unexported fields
}

AccountCreatedSubscription is a struct for listening to all 'AccountCreated' contract events and return them as models.Account struct

func (AccountCreatedSubscription) Close added in v0.1.19

func (s AccountCreatedSubscription) Close()

Close is used to stop the event chanel and send the `stop` signal

type AccountLiquidatedSubscription added in v0.1.19

type AccountLiquidatedSubscription struct {
	AccountLiquidated chan *models.AccountLiquidated
	// contains filtered or unexported fields
}

AccountLiquidatedSubscription is a struct for listening to all 'AccountLiquidated' contract events and return them as models.AccountLiquidated struct

func (AccountLiquidatedSubscription) Close added in v0.1.19

func (s AccountLiquidatedSubscription) Close()

Close is used to stop the event chanel and send the `stop` signal

type AccountPermissionGrantedSubscription added in v0.1.19

type AccountPermissionGrantedSubscription struct {
	PermissionChangeChan chan *models.PermissionChanged
	// contains filtered or unexported fields
}

AccountPermissionGrantedSubscription is a struct for listening to all 'PermissionGranted' contract events and return them as models.PermissionChanged struct

func (AccountPermissionGrantedSubscription) Close added in v0.1.19

func (s AccountPermissionGrantedSubscription) Close()

Close is used to stop the event chanel and send the `stop` signal

type AccountPermissionRevokedSubscription added in v0.1.19

type AccountPermissionRevokedSubscription struct {
	PermissionChangeChan chan *models.PermissionChanged
	// contains filtered or unexported fields
}

AccountPermissionRevokedSubscription is a struct for listening to all 'PermissionRevoked' contract events and return them as models.PermissionChanged struct

func (AccountPermissionRevokedSubscription) Close added in v0.1.19

func (s AccountPermissionRevokedSubscription) Close()

Close is used to stop the event chanel and send the `stop` signal

type CollateralDepositedSubscription added in v0.3.9

type CollateralDepositedSubscription struct {
	CollateralDepositedChan chan *models.CollateralDeposited
	// contains filtered or unexported fields
}

CollateralDepositedSubscription is a struct for listening to all 'Deposited' contract events and return them as models.CollateralDeposited struct

func (CollateralDepositedSubscription) Close added in v0.3.9

func (s CollateralDepositedSubscription) Close()

Close is used to stop the event chanel and send the `stop` signal

type CollateralWithdrawnSubscription added in v0.3.9

type CollateralWithdrawnSubscription struct {
	CollateralWithdrawnChan chan *models.CollateralWithdrawn
	// contains filtered or unexported fields
}

CollateralWithdrawnSubscription is a struct for listening to all 'Withdrawn' contract events and return them as models.CollateralWithdrawn struct

func (CollateralWithdrawnSubscription) Close added in v0.3.9

func (s CollateralWithdrawnSubscription) Close()

Close is used to stop the event chanel and send the `stop` signal

type DelegationUpdatedSubscription added in v0.3.8

type DelegationUpdatedSubscription struct {
	DelegationUpdatedChan chan *models.DelegationUpdated
	// contains filtered or unexported fields
}

DelegationUpdatedSubscription is a struct for listening to all 'DelegationUpdated' contract events and return them as models.DelegationUpdated struct

func (DelegationUpdatedSubscription) Close added in v0.3.8

func (s DelegationUpdatedSubscription) Close()

Close is used to stop the event chanel and send the `stop` signal

type Events

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

Events implements IEvents interface

func (*Events) ListenAccountCreated added in v0.1.19

func (e *Events) ListenAccountCreated() (*AccountCreatedSubscription, error)

func (*Events) ListenAccountLiquidated added in v0.1.19

func (e *Events) ListenAccountLiquidated() (*AccountLiquidatedSubscription, error)

func (*Events) ListenAccountPermissionGranted added in v0.1.19

func (e *Events) ListenAccountPermissionGranted() (*AccountPermissionGrantedSubscription, error)

func (*Events) ListenAccountPermissionRevoked added in v0.1.19

func (e *Events) ListenAccountPermissionRevoked() (*AccountPermissionRevokedSubscription, error)

func (*Events) ListenCollateralDeposited added in v0.3.9

func (e *Events) ListenCollateralDeposited() (*CollateralDepositedSubscription, error)

func (*Events) ListenCollateralWithdrawn added in v0.3.9

func (e *Events) ListenCollateralWithdrawn() (*CollateralWithdrawnSubscription, error)

func (*Events) ListenDelegationUpdated added in v0.3.8

func (e *Events) ListenDelegationUpdated() (*DelegationUpdatedSubscription, error)

func (*Events) ListenLiquidations added in v0.1.3

func (e *Events) ListenLiquidations() (*LiquidationSubscription, error)

func (*Events) ListenMarketRegistered added in v0.8.0

func (e *Events) ListenMarketRegistered() (*MarketRegisteredSubscription, error)

func (*Events) ListenMarketUSDDeposited added in v0.6.0

func (e *Events) ListenMarketUSDDeposited() (*MarketUSDDepositedSubscription, error)

func (*Events) ListenMarketUSDWithdrawn added in v0.6.0

func (e *Events) ListenMarketUSDWithdrawn() (*MarketUSDWithdrawnSubscription, error)

func (*Events) ListenMarketUpdates added in v0.1.1

func (e *Events) ListenMarketUpdates() (*MarketUpdateSubscription, error)

func (*Events) ListenMarketUpdatesBig added in v0.1.9

func (e *Events) ListenMarketUpdatesBig() (*MarketUpdateSubscriptionBig, error)

func (*Events) ListenOrders added in v0.1.0

func (e *Events) ListenOrders() (*OrderSubscription, error)

func (*Events) ListenPoolCreated added in v0.9.0

func (e *Events) ListenPoolCreated() (*PoolCreatedSubscription, error)

func (*Events) ListenRewardClaimed added in v0.4.0

func (e *Events) ListenRewardClaimed() (*RewardClaimedSubscription, error)

func (*Events) ListenRewardDistributed added in v0.4.0

func (e *Events) ListenRewardDistributed() (*RewardDistributedSubscription, error)

func (*Events) ListenTrades

func (e *Events) ListenTrades() (*TradeSubscription, error)

func (*Events) ListenUSDBurned added in v0.3.8

func (e *Events) ListenUSDBurned() (*USDBurnedSubscription, error)

func (*Events) ListenUSDMinted added in v0.3.7

func (e *Events) ListenUSDMinted() (*USDMintedSubscription, error)

type IEvents

type IEvents interface {
	// ListenTrades is used to listen to all 'OrderSettled' contract events and return them as models.Trade struct and
	// return errors on ErrChan chanel
	ListenTrades() (*TradeSubscription, error)

	// ListenOrders is used to listen to all 'OrderCommitted' contract events and return them as models.Order struct and
	// return errors on ErrChan chanel
	ListenOrders() (*OrderSubscription, error)

	// ListenMarketUpdates is used to listen to all 'MarketUpdated' contract events and return them as models.MarketUpdate
	// struct and return errors on ErrChan chanel
	ListenMarketUpdates() (*MarketUpdateSubscription, error)

	// ListenMarketUpdatesBig is used to listen to all 'MarketUpdated' contract events and return them as models.MarketUpdateBig
	// struct and return errors on ErrChan chanel
	ListenMarketUpdatesBig() (*MarketUpdateSubscriptionBig, error)

	// ListenLiquidations is used to listen to all 'PositionLiquidated' contract events and return them as models.Liquidation
	// struct and return errors on ErrChan chanel
	ListenLiquidations() (*LiquidationSubscription, error)

	// ListenAccountCreated is used to listen to all 'AccountCreated' contract events and return them as models.Account
	// struct and return errors on ErrChan chanel
	ListenAccountCreated() (*AccountCreatedSubscription, error)

	// ListenAccountLiquidated is used to listen to all 'AccountLiquidated' contract events and return them as models.AccountLiquidated
	// struct and return errors on ErrChan chanel
	ListenAccountLiquidated() (*AccountLiquidatedSubscription, error)

	// ListenAccountPermissionRevoked is used to listen to all 'PermissionRevoked' contract events and return them as models.PermissionChanged
	// struct and return errors on ErrChan chanel
	ListenAccountPermissionRevoked() (*AccountPermissionRevokedSubscription, error)

	// ListenAccountPermissionGranted is used to listen to all 'PermissionGranted' contract events and return them as models.PermissionChanged
	// struct and return errors on ErrChan chanel
	ListenAccountPermissionGranted() (*AccountPermissionGrantedSubscription, error)

	// ListenUSDMinted is used to listen to all 'USDMinted' Core contract events and return them as models.USDMinted
	// struct and return errors on ErrChan chanel
	ListenUSDMinted() (*USDMintedSubscription, error)

	// ListenUSDBurned is used to listen to all 'USDBurned' Core contract events and return them as models.USDBurned
	// struct and return errors on ErrChan chanel
	ListenUSDBurned() (*USDBurnedSubscription, error)

	// ListenDelegationUpdated is used to listen to all 'DelegationUpdated' Core contract events and return them as models.DelegationUpdated
	// struct and return errors on ErrChan chanel
	ListenDelegationUpdated() (*DelegationUpdatedSubscription, error)

	// ListenCollateralWithdrawn is used to listen to all 'Withdrawn' Core contract events and return them as models.CollateralWithdrawn
	// struct and return errors on ErrChan chanel
	ListenCollateralWithdrawn() (*CollateralWithdrawnSubscription, error)

	// ListenCollateralDeposited is used to listen to all 'Deposited' Core contract events and return them as models.CollateralDeposited
	// struct and return errors on ErrChan chanel
	ListenCollateralDeposited() (*CollateralDepositedSubscription, error)

	// ListenRewardDistributed is used to listen to all 'RewardDistributed' Core contract events and return them as models.RewardDistributed
	// struct and return errors on ErrChan chanel
	ListenRewardDistributed() (*RewardDistributedSubscription, error)

	// ListenRewardClaimed is used to listen to all 'RewardClaimed' Core contract events and return them as models.RewardClaimed
	// struct and return errors on ErrChan chanel
	ListenRewardClaimed() (*RewardClaimedSubscription, error)

	// ListenMarketUSDWithdrawn is used to listen to all 'MarketUSDWithdrawn' Core contract events and return them as models.MarketUSDWithdrawn
	// struct and return errors on ErrChan chanel
	ListenMarketUSDWithdrawn() (*MarketUSDWithdrawnSubscription, error)

	// ListenMarketUSDDeposited is used to listen to all 'MarketUSDDeposited' Core contract events and return them as models.MarketUSDDeposited
	// struct and return errors on ErrChan chanel
	ListenMarketUSDDeposited() (*MarketUSDDepositedSubscription, error)

	// ListenMarketRegistered is used to listen to all 'MarketRegistered' Core contract events and return them as models.MarketRegistered
	// struct and return errors on ErrChan chanel
	ListenMarketRegistered() (*MarketRegisteredSubscription, error)

	// ListenPoolCreated is used to listen to all 'PoolCreated' Core contract events and return them as models.PoolCreated
	// struct and return errors on ErrChan chanel
	ListenPoolCreated() (*PoolCreatedSubscription, error)
}

IEvents is an interface that is used to work with contract event listeners

func NewEvents

func NewEvents(
	client *ethclient.Client,
	core *core.Core,
	perpsMarket *perpsMarket.PerpsMarket,
) IEvents

NewEvents is used to create new Events instance that implements IEvents interface

type LiquidationSubscription added in v0.1.3

type LiquidationSubscription struct {
	LiquidationsChan chan *models.Liquidation
	// contains filtered or unexported fields
}

LiquidationSubscription is a struct for listening to all 'PositionLiquidated' contract events and return them as models.Liquidation struct

func (LiquidationSubscription) Close added in v0.1.3

func (s LiquidationSubscription) Close()

Close is used to stop the event chanel and send the `stop` signal

type MarketRegisteredSubscription added in v0.8.0

type MarketRegisteredSubscription struct {
	MarketRegisteredChan chan *models.MarketRegistered
	// contains filtered or unexported fields
}

MarketRegisteredSubscription is a struct for listening to all 'MarketRegistered' contract events and return them as models.MarketRegistered struct

func (MarketRegisteredSubscription) Close added in v0.8.0

func (s MarketRegisteredSubscription) Close()

Close is used to stop the event chanel and send the `stop` signal

type MarketUSDDepositedSubscription added in v0.6.0

type MarketUSDDepositedSubscription struct {
	MarketUSDDepositedChan chan *models.MarketUSDDeposited
	// contains filtered or unexported fields
}

MarketUSDDepositedSubscription is a struct for listening to all 'MarketUSDDeposited' contract events and return them as models.MarketUSDDeposited struct

func (MarketUSDDepositedSubscription) Close added in v0.6.0

func (s MarketUSDDepositedSubscription) Close()

Close is used to stop the event chanel and send the `stop` signal

type MarketUSDWithdrawnSubscription added in v0.6.0

type MarketUSDWithdrawnSubscription struct {
	MarketUSDWithdrawnChan chan *models.MarketUSDWithdrawn
	// contains filtered or unexported fields
}

MarketUSDWithdrawnSubscription is a struct for listening to all 'MarketUSDWithdrawn' contract events and return them as models.MarketUSDWithdrawn struct

func (MarketUSDWithdrawnSubscription) Close added in v0.6.0

func (s MarketUSDWithdrawnSubscription) Close()

Close is used to stop the event chanel and send the `stop` signal

type MarketUpdateSubscription added in v0.1.1

type MarketUpdateSubscription struct {
	MarketUpdatesChan chan *models.MarketUpdate
	// contains filtered or unexported fields
}

MarketUpdateSubscription is a struct for listening to all 'MarketUpdated' contract events and return them as models.MarketUpdate struct

func (MarketUpdateSubscription) Close added in v0.1.1

func (s MarketUpdateSubscription) Close()

Close is used to stop the event chanel and send the `stop` signal

type MarketUpdateSubscriptionBig added in v0.1.9

type MarketUpdateSubscriptionBig struct {
	MarketUpdatesChan chan *models.MarketUpdateBig
	// contains filtered or unexported fields
}

MarketUpdateSubscriptionBig is a struct for listening to all 'MarketUpdated' contract events and return them as models.MarketUpdateBig struct

func (MarketUpdateSubscriptionBig) Close added in v0.1.9

func (s MarketUpdateSubscriptionBig) Close()

Close is used to stop the event chanel and send the `stop` signal

type OrderSubscription added in v0.1.0

type OrderSubscription struct {
	OrdersChan chan *models.Order
	// contains filtered or unexported fields
}

OrderSubscription is a struct for listening to all 'OrderCommitted' contract events and return them as models.Order struct

func (OrderSubscription) Close added in v0.1.0

func (s OrderSubscription) Close()

Close is used to stop the event chanel and send the `stop` signal

type PoolCreatedSubscription added in v0.9.0

type PoolCreatedSubscription struct {
	PoolCreatedChan chan *models.PoolCreated
	// contains filtered or unexported fields
}

PoolCreatedSubscription is a struct for listening to all 'PoolCreated' contract events and return them as models.PoolCreated struct

func (PoolCreatedSubscription) Close added in v0.9.0

func (s PoolCreatedSubscription) Close()

Close is used to stop the event chanel and send the `stop` signal

type RewardClaimedSubscription added in v0.4.0

type RewardClaimedSubscription struct {
	RewardClaimedChan chan *models.RewardClaimed
	// contains filtered or unexported fields
}

RewardClaimedSubscription is a struct for listening to all 'RewardClaimed' contract events and return them as models.RewardClaimed struct

func (RewardClaimedSubscription) Close added in v0.4.0

func (s RewardClaimedSubscription) Close()

Close is used to stop the event chanel and send the `stop` signal

type RewardDistributedSubscription added in v0.4.0

type RewardDistributedSubscription struct {
	RewardDistributedChan chan *models.RewardDistributed
	// contains filtered or unexported fields
}

RewardDistributedSubscription is a struct for listening to all 'RewardDistributed' contract events and return them as models.RewardDistributed struct

func (RewardDistributedSubscription) Close added in v0.4.0

func (s RewardDistributedSubscription) Close()

Close is used to stop the event chanel and send the `stop` signal

type TradeSubscription

type TradeSubscription struct {
	TradesChan chan *models.Trade
	// contains filtered or unexported fields
}

TradeSubscription is a struct for listening to all 'OrderSettled' contract events and return them as models.Trade struct

func (TradeSubscription) Close

func (s TradeSubscription) Close()

Close is used to stop the event chanel and send the `stop` signal

type USDBurnedSubscription added in v0.3.8

type USDBurnedSubscription struct {
	USDBurnedChan chan *models.USDBurned
	// contains filtered or unexported fields
}

USDBurnedSubscription is a struct for listening to all 'UsdBurned' contract events and return them as models.USDBurned struct

func (USDBurnedSubscription) Close added in v0.3.8

func (s USDBurnedSubscription) Close()

Close is used to stop the event chanel and send the `stop` signal

type USDMintedSubscription added in v0.3.7

type USDMintedSubscription struct {
	USDMintedsChan chan *models.USDMinted
	// contains filtered or unexported fields
}

USDMintedSubscription is a struct for listening to all 'UsdMinted' contract events and return them as models.USDMinted struct

func (USDMintedSubscription) Close added in v0.3.7

func (s USDMintedSubscription) Close()

Close is used to stop the event chanel and send the `stop` signal

Jump to

Keyboard shortcuts

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