parser

package
v0.0.0-...-4582ed7 Latest Latest
Warning

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

Go to latest
Published: Jan 22, 2024 License: GPL-3.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Chain           = "TRON"
	SyncTopicsCount = 4
)
View Source
const JMFactoryABI = `` /* 3510-byte string literal not displayed */
View Source
const SwftSwapEvent = 0x45f377f8
View Source
const Univ3EventidShort = 0xc42079f9

Variables

This section is empty.

Functions

func GetUniV2Buy

func GetUniV2Buy(amount0In, amount0Out, amount1In, amount1Out *big.Int) bool

GetUniV2Buy Returns Buy true/false

Types

type Parser

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

func New

func New(api *tronApi.API,
	lists *integrations.TokenListsProvider,
	pairsCache cache.PairCache,
	converter *converters.FiatConverter,
	abiHolder *abi.Holder,
	swLists *integrations.SunswapProvider) *Parser

func (*Parser) CreatePair

func (p *Parser) CreatePair(_ context.Context, addr *tronApi.Address, klass string) (*models.Pair, bool)

func (*Parser) DeleteHolders

func (p *Parser) DeleteHolders()

func (*Parser) GetEncodedBlock

func (p *Parser) GetEncodedBlock() []byte

func (*Parser) GetEncodedHolders

func (p *Parser) GetEncodedHolders() []byte

func (*Parser) GetPairTokens

func (p *Parser) GetPairTokens(pair *tronApi.Address, klass string) (tokenA, tokenB *models.Token, ok bool)

func (*Parser) GetSunswapToken

func (p *Parser) GetSunswapToken(addr *tronApi.Address) (string, bool)

GetSunswapToken - NOTICE This could fail due to "this node doesnt support constant"

func (*Parser) GetTokenDecimals

func (p *Parser) GetTokenDecimals(address *tronApi.Address) (int32, bool)

func (*Parser) Parse

func (p *Parser) Parse(block models.Block) bool

Parse - parse single block

type State

type State struct {
	DirectSwaps []*models.DirectSwap     `json:"direct_swaps"`
	PairSwaps   []*models.PairSwap       `json:"pair_swaps"`
	Liquidities []*models.LiquidityEvent `json:"liquidity_events"`
	Transfers   []*models.TransferEvent  `json:"transfer_events"`
	Pairs       []*models.NewPair        `json:"new_pairs"`
	Holders     []*models.Holder         `json:"holders"`
	Block       *models.Block            `json:"block"`
	// contains filtered or unexported fields
}

func CreateState

func CreateState(block *models.Block) *State

func (*State) AddDirectSwap

func (i *State) AddDirectSwap(m *models.DirectSwap)

func (*State) AddLiquidity

func (i *State) AddLiquidity(liquidity *models.LiquidityEvent)

func (*State) AddProcessHolder

func (i *State) AddProcessHolder(h *models.Holder)

func (*State) AddTrade

func (i *State) AddTrade(trade *models.PairSwap)

func (*State) AddTransferEvent

func (i *State) AddTransferEvent(transfer *models.TransferEvent)

func (*State) RegisterNewPair

func (i *State) RegisterNewPair(factory, pair, klass, network, node string, blockTime time.Time)

Jump to

Keyboard shortcuts

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