Versions in this module Expand all Collapse all v0 v0.1.6 Feb 13, 2023 v0.1.5 Feb 11, 2023 v0.1.4 Feb 10, 2023 v0.1.3 Feb 10, 2023 Changes in this version + const KafkaBrokerSep + const MaxOrderBookLevel + const ToRemoveOrderIdChannelSize + const TransferCollectionChannelSize + var Cfg *config.PublicationConfig + var IsLive bool + var Logger tmlog.Logger + var Pool = newPool() + var ToPublishCh chan BlockInfoToPublish + var ToPublishEventCh chan *sub.ToPublishEvent + var ToRemoveOrderIdCh chan OrderSymbolId + func CollectProposalsForPublish(passed, failed []gov.SimpleProposal) (Proposals, SideProposals) + func DelistTradingPairForPublish(ctx sdk.Context, dexKeeper *orderPkg.DexKeeper, symbol string) + func ExpireOrdersForPublish(dexKeeper *orderPkg.DexKeeper, ctx sdk.Context, blockTime time.Time) + func GetAccountBalances(mapper auth.AccountKeeper, ctx sdk.Context, accSlices ...[]string) (res map[string]Account) + func GetTradeAndOrdersRelatedAccounts(tradesToPublish []*Trade, orderChanges orderPkg.OrderChanges, ...) []string + func Publish(publisher MarketDataPublisher, metrics *Metrics, Logger tmlog.Logger, ...) + func PublishEvent(publisher MarketDataPublisher, Logger tmlog.Logger, ...) + func Stop(publisher MarketDataPublisher) + func Timer(logger tmlog.Logger, description string, op func()) (durationMs int64) + type Account struct + Balances []*AssetBalance + Fee string + Owner string + Sequence int64 + func (msg *Account) MarshalJSON() ([]byte, error) + func (msg *Account) String() string + func (msg *Account) ToNativeMap() map[string]interface{} + type Accounts struct + Accounts []Account + Height int64 + NumOfMsgs int + func (msg *Accounts) EmptyCopy() AvroOrJsonMsg + func (msg *Accounts) EssentialMsg() string + func (msg *Accounts) String() string + func (msg *Accounts) ToNativeMap() map[string]interface{} + type AggregatedMarketDataPublisher struct + func NewAggregatedMarketDataPublisher(publishers ...MarketDataPublisher) (publisher *AggregatedMarketDataPublisher) + func (publisher *AggregatedMarketDataPublisher) Stop() + type AllocatedAmt struct + Address string + Amount int64 + func (msg *AllocatedAmt) String() string + type AssetBalance struct + Asset string + Free int64 + Frozen int64 + Locked int64 + func (msg *AssetBalance) String() string + func (msg *AssetBalance) ToNativeMap() map[string]interface{} + type AvroOrJsonMsg interface + String func() string + ToNativeMap func() map[string]interface{} + type Block struct + ChainID string + CryptoBlock CryptoBlock + func GetBlockPublished(pool *sdk.Pool, header abci.Header, blockHash []byte) *Block + func (msg Block) String() string + func (msg Block) ToNativeMap() map[string]interface{} + type BlockFee struct + Fee string + Height int64 + Validators []string + func (msg BlockFee) MarshalJSON() ([]byte, error) + func (msg BlockFee) String() string + func (msg BlockFee) ToNativeMap() map[string]interface{} + type BlockInfoToPublish struct + func NewBlockInfoToPublish(height int64, timestamp int64, tradesToPublish []*Trade, ...) BlockInfoToPublish + type Books struct + Books []OrderBookDelta + Height int64 + NumOfMsgs int + Timestamp int64 + func (msg *Books) String() string + func (msg *Books) ToNativeMap() map[string]interface{} + type BreatheBlockMsg struct + Height int64 + Timestamp int64 + func (msg *BreatheBlockMsg) EmptyCopy() AvroOrJsonMsg + func (msg *BreatheBlockMsg) EssentialMsg() string + func (msg *BreatheBlockMsg) String() string + func (msg *BreatheBlockMsg) ToNativeMap() map[string]interface{} + type Coin struct + Amount int64 + Denom string + func (coin Coin) String() string + func (msg Coin) ToNativeMap() map[string]interface{} + type CompletedReDelegation struct + Delegator sdk.AccAddress + ValidatorDst sdk.ValAddress + ValidatorSrc sdk.ValAddress + func (msg *CompletedReDelegation) String() string + type CompletedUnbondingDelegation struct + Amount Coin + Delegator sdk.AccAddress + Validator sdk.ValAddress + func (msg *CompletedUnbondingDelegation) String() string + type CrossReceiver struct + Addr string + Amount int64 + func (msg CrossReceiver) String() string + func (msg CrossReceiver) ToNativeMap() map[string]interface{} + type CrossTransfer struct + ChainId string + Contract string + Decimals int + Denom string + From string + RelayerFee int64 + To []CrossReceiver + TxHash string + Type string + func (msg CrossTransfer) String() string + func (msg CrossTransfer) ToNativeMap() map[string]interface{} + type CrossTransfers struct + Height int64 + Num int + Timestamp int64 + Transfers []CrossTransfer + func (msg CrossTransfers) String() string + func (msg CrossTransfers) ToNativeMap() map[string]interface{} + type CryptoBlock struct + BlockHash string + BlockHeight int64 + BlockMeta NativeBlockMeta + ParentHash string + Timestamp string + Transactions []Transaction + TxTotal int64 + func (msg CryptoBlock) String() string + func (msg CryptoBlock) ToNativeMap() map[string]interface{} + type DelegateEvent struct + Amount Coin + Delegator sdk.AccAddress + TxHash string + Validator sdk.ValAddress + func (msg *DelegateEvent) String() string + type Delegation stake.Delegation + func (msg *Delegation) String() string + type Distribution struct + Commission int64 + DistributeAddr sdk.AccAddress + Rewards []*Reward + SelfDelegator sdk.AccAddress + TotalReward int64 + ValTokens int64 + Validator sdk.ValAddress + func (msg *Distribution) String() string + type DistributionMsg struct + Distributions map[string][]*Distribution + Height int64 + NumOfMsgs int + Timestamp int64 + func (msg *DistributionMsg) EmptyCopy() AvroOrJsonMsg + func (msg *DistributionMsg) EssentialMsg() string + func (msg *DistributionMsg) String() string + func (msg *DistributionMsg) ToNativeMap() map[string]interface{} + type EssMsg interface + EmptyCopy func() AvroOrJsonMsg + EssentialMsg func() string + type ExecutionResults struct + Height int64 + NumOfMsgs int + Orders Orders + Proposals Proposals + StakeUpdates StakeUpdates + Timestamp int64 + Trades trades + func (msg *ExecutionResults) EmptyCopy() AvroOrJsonMsg + func (msg *ExecutionResults) EssentialMsg() string + func (msg *ExecutionResults) String() string + func (msg *ExecutionResults) ToNativeMap() map[string]interface{} + type Input struct + Address string + Coins []Coin + func (msg Input) String() string + func (msg Input) ToNativeMap() map[string]interface{} + type KafkaMarketDataPublisher struct + func NewKafkaMarketDataPublisher(logger log.Logger, dbDir string, failFast bool) (publisher *KafkaMarketDataPublisher) + func (publisher *KafkaMarketDataPublisher) Stop() + type LocalMarketDataPublisher struct + func NewLocalMarketDataPublisher(dataPath string, tmLogger tmLogger.Logger, config *config.PublicationConfig) (publisher *LocalMarketDataPublisher) + func (publisher *LocalMarketDataPublisher) Stop() + type MarketDataPublisher interface + Stop func() + type Metrics struct + CollectBlockTimeMs metricsPkg.Gauge + CollectOrderBookTimeMs metricsPkg.Gauge + NumAccounts metricsPkg.Gauge + NumOrder metricsPkg.Gauge + NumOrderBook metricsPkg.Gauge + NumOrderInfoForPublish metricsPkg.Gauge + NumTrade metricsPkg.Gauge + NumTransfers metricsPkg.Gauge + PublicationBlockIntervalMs metricsPkg.Gauge + PublicationHeight metricsPkg.Gauge + PublicationQueueSize metricsPkg.Gauge + PublishAccountTimeMs metricsPkg.Gauge + PublishBlockTimeMs metricsPkg.Gauge + PublishBlockfeeTimeMs metricsPkg.Gauge + PublishOrderbookTimeMs metricsPkg.Gauge + PublishSideProposalTimeMs metricsPkg.Gauge + PublishTotalTimeMs metricsPkg.Gauge + PublishTradeAndOrderTimeMs metricsPkg.Gauge + PublishTransfersTimeMs metricsPkg.Gauge + func PrometheusMetrics() *Metrics + type Mirror struct + BEP20Name string + BEP20Symbol string + BEP2Symbol string + ChainId string + Contract string + Decimals int + Fee int64 + OldTotalSupply int64 + RelayerFee int64 + Sender string + TotalSupply int64 + TxHash string + Type string + func (msg Mirror) String() string + func (msg Mirror) ToNativeMap() map[string]interface{} + type Mirrors struct + Height int64 + Mirrors []Mirror + Num int + Timestamp int64 + func (msg Mirrors) String() string + func (msg Mirrors) ToNativeMap() map[string]interface{} + type MockMarketDataPublisher struct + AccountPublished []*Accounts + BlockFeePublished []BlockFee + BlockPublished []*Block + BooksPublished []*Books + ExecutionResultsPublished []*ExecutionResults + Lock *deadlock.Mutex + MessagePublished uint32 + TransferPublished []Transfers + func NewMockMarketDataPublisher() (publisher *MockMarketDataPublisher) + func (publisher *MockMarketDataPublisher) Stop() + type NativeBlockMeta struct + AppHash string + ConsensusHash string + DataHash string + EvidenceHash string + LastCommitHash string + LastResultsHash string + NextValidatorsHash string + ProposerAddress string + ValidatorsHash string + func (msg NativeBlockMeta) String() string + func (msg NativeBlockMeta) ToNativeMap() map[string]interface{} + type NativeTransaction struct + Code uint32 + Data string + OrderId string + ProposalId int64 + Source int64 + TxAsset string + TxType string + func (msg NativeTransaction) String() string + func (msg NativeTransaction) ToNativeMap() map[string]interface{} + type Order struct + CumQty int64 + CurrentExecutionType orderPkg.ExecutionType + Fee string + LastExecutedPrice int64 + LastExecutedQty int64 + OrderCreationTime int64 + OrderId string + OrderType int8 + Owner string + Price int64 + Qty int64 + Side int8 + SingleFee string + Status orderPkg.ChangeType + Symbol string + TimeInForce int8 + TradeId string + TransactionTime int64 + TxHash string + func (msg *Order) String() string + type OrderBookDelta struct + Buys []PriceLevel + Sells []PriceLevel + Symbol string + func (msg *OrderBookDelta) String() string + func (msg *OrderBookDelta) ToNativeMap() map[string]interface{} + type OrderSymbolId struct + Id string + Symbol string + type Orders struct + NumOfMsgs int + Orders []*Order + func (msg *Orders) EssentialMsg() string + func (msg *Orders) String() string + func (msg *Orders) ToNativeMap() map[string]interface{} + type Output struct + Address string + Coins []Coin + func (msg Output) String() string + func (msg Output) ToNativeMap() map[string]interface{} + type PriceLevel struct + LastQty int64 + Price int64 + func (msg *PriceLevel) String() string + func (msg *PriceLevel) ToNativeMap() map[string]interface{} + type Proposal struct + Id int64 + Status ProposalStatus + func (msg *Proposal) String() string + type ProposalStatus uint8 + const Failed + const Succeed + func (this ProposalStatus) String() string + type Proposals struct + NumOfMsgs int + Proposals []*Proposal + func (msg *Proposals) String() string + func (msg *Proposals) ToNativeMap() map[string]interface{} + type ReDelegation stake.Redelegation + func (msg *ReDelegation) String() string + type Receiver struct + Addr string + Coins []Coin + func (msg Receiver) String() string + func (msg Receiver) ToNativeMap() map[string]interface{} + type RedelegateEvent struct + Amount Coin + Delegator sdk.AccAddress + TxHash string + ValidatorDst sdk.ValAddress + ValidatorSrc sdk.ValAddress + func (msg *RedelegateEvent) String() string + type Reward struct + Amount int64 + Delegator sdk.AccAddress + Tokens int64 + Validator sdk.ValAddress + func (msg *Reward) String() string + type SideProposal struct + ChainId string + Id int64 + Status ProposalStatus + func (msg *SideProposal) String() string + type SideProposals struct + Height int64 + NumOfMsgs int + Proposals []*SideProposal + Timestamp int64 + func (msg *SideProposals) String() string + func (msg *SideProposals) ToNativeMap() map[string]interface{} + type Slash struct + InfractionHeight int64 + InfractionType byte + JailUtil int64 + SlashAmount int64 + Submitter sdk.AccAddress + SubmitterReward int64 + ToFeePool int64 + Validator sdk.ValAddress + ValidatorsCompensation []*AllocatedAmt + func (msg *Slash) String() string + type SlashMsg struct + Height int64 + NumOfMsgs int + SlashData map[string][]*Slash + Timestamp int64 + func (msg *SlashMsg) EmptyCopy() AvroOrJsonMsg + func (msg *SlashMsg) EssentialMsg() string + func (msg *SlashMsg) String() string + func (msg *SlashMsg) ToNativeMap() map[string]interface{} + type StakeUpdates struct + CompletedUnbondingDelegations []*CompletedUnbondingDelegation + NumOfMsgs int + func CollectStakeUpdatesForPublish(unbondingDelegations []stake.UnbondingDelegation) StakeUpdates + func (msg *StakeUpdates) String() string + func (msg *StakeUpdates) ToNativeMap() map[string]interface{} + type StakingMsg struct + CompletedREDs map[string][]*CompletedReDelegation + CompletedUBDs map[string][]*CompletedUnbondingDelegation + DelegateEvents map[string][]*DelegateEvent + Delegations map[string][]*Delegation + ElectedValidators map[string][]*Validator + Height int64 + NumOfMsgs int + ReDelegations map[string][]*ReDelegation + RedelegateEvents map[string][]*RedelegateEvent + RemovedValidators map[string][]sdk.ValAddress + Timestamp int64 + UnbondingDelegations map[string][]*UnbondingDelegation + UndelegateEvents map[string][]*UndelegateEvent + Validators []*Validator + func (msg *StakingMsg) EmptyCopy() AvroOrJsonMsg + func (msg *StakingMsg) EssentialMsg() string + func (msg *StakingMsg) String() string + func (msg *StakingMsg) ToNativeMap() map[string]interface{} + type Trade struct + BAddr string + BSingleFee string + BSrc int64 + Bfee string + Bid string + Id string + Price int64 + Qty int64 + SAddr string + SSingleFee string + SSrc int64 + Sfee string + Sid string + Symbol string + TickType int + func MatchAndAllocateAllForPublish(dexKeeper *orderPkg.DexKeeper, ctx sdk.Context, matchAllMiniSymbols bool) []*Trade + func (msg *Trade) MarshalJSON() ([]byte, error) + func (msg *Trade) String() string + type Transaction struct + Fee string + Inputs []Input + NativeTransaction NativeTransaction + Outputs []Output + Timestamp string + TxHash string + func (msg Transaction) String() string + func (msg Transaction) ToNativeMap() map[string]interface{} + type Transfer struct + From string + Memo string + To []Receiver + TxHash string + func (msg Transfer) String() string + func (msg Transfer) ToNativeMap() map[string]interface{} + type Transfers struct + Height int64 + Num int + Timestamp int64 + Transfers []Transfer + func GetTransferPublished(pool *sdk.Pool, height, blockTime int64) *Transfers + func (msg Transfers) String() string + func (msg Transfers) ToNativeMap() map[string]interface{} + type UnbondingDelegation stake.UnbondingDelegation + func (msg *UnbondingDelegation) String() string + type UndelegateEvent struct + Amount Coin + Delegator sdk.AccAddress + TxHash string + Validator sdk.ValAddress + func (msg *UndelegateEvent) String() string + type Validator stake.Validator + func (msg *Validator) String() string