Documentation ¶
Index ¶
- func FakerCustomGenerator()
- func IndexOf[T comparable](slice []T, target T) int
- func NewDexApp(app TargetApp, srcStore SourceDataStore, repo Repo, logger logging.Logger, ...) *dexApp
- type Asset
- type Dex
- type DexMixin
- type Mapper
- type Pair
- type PairParsers
- type PairRepo
- type ParsedTx
- type Parser
- type ParserMock
- type PoolInfo
- type RawStoreMock
- type RawTx
- type RawTxs
- type Repo
- type RepoMock
- type Runner
- type SourceDataStore
- type TargetApp
- type TxType
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewDexApp ¶
func NewDexApp(app TargetApp, srcStore SourceDataStore, repo Repo, logger logging.Logger, c configs.ParserConfig) *dexApp
Types ¶
type Asset ¶
func FakeParserAssets ¶
func FakeParserAssets() []Asset
type Mapper ¶
type Mapper interface { // return nil if the matched result is not for this parser MatchedToParsedTx(eventlog.MatchedResult, ...interface{}) (*ParsedTx, error) }
type Pair ¶
type Pair struct { ContractAddr string `json:"contractAddr"` Assets []string `json:"assets"` LpAddr string `json:"lpAddr"` }
func FakeParserPairs ¶
func FakeParserPairs() []Pair
type PairParsers ¶
type ParsedTx ¶
type ParsedTx struct { Hash string `json:"hash"` Timestamp time.Time `json:"timestamp"` // timestamp of a block Type TxType `json:"type" faker:"parserTxType"` Sender string `json:"sender"` ContractAddr string `json:"contractAddr"` Assets [2]Asset `json:"assets"` LpAddr string `json:"lpAddr"` LpAmount string `json:"lpAmount" faker:"amountString"` CommissionAmount string `json:"commissionAmount" faker:"amountString"` Meta map[string]interface{} `json:"meta" faker:"meta"` }
func FakeParserParsedTxs ¶
func FakeParserParsedTxs() []ParsedTx
type Parser ¶
type ParserMock ¶
func (*ParserMock) MatchedToParsedTx ¶
func (p *ParserMock) MatchedToParsedTx(result eventlog.MatchedResult, optional ...interface{}) (*ParsedTx, error)
matchedToParsedTx implements parser
func (*ParserMock) Parse ¶
func (p *ParserMock) Parse(hash string, timestamp time.Time, raws eventlog.LogResults, optionals ...interface{}) ([]*ParsedTx, error)
parse implements parser
type PoolInfo ¶
func FakeParserPoolInfoTxs ¶
func FakeParserPoolInfoTxs() []PoolInfo
type RawStoreMock ¶
func (*RawStoreMock) GetPoolInfos ¶
func (r *RawStoreMock) GetPoolInfos(height uint64) ([]PoolInfo, error)
GetPoolInfos implements RawDataStore
func (*RawStoreMock) GetSourceSyncedHeight ¶
func (r *RawStoreMock) GetSourceSyncedHeight() (uint64, error)
GetSourceSyncedHeight implements RawDataStore
func (*RawStoreMock) GetSourceTxs ¶
func (r *RawStoreMock) GetSourceTxs(height uint64) (RawTxs, error)
GetSourceTxs implements RawDataStore
type RepoMock ¶
func (*RepoMock) GetSyncedHeight ¶
GetSyncedHeight implements Repo
type SourceDataStore ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.