Documentation ¶
Index ¶
- type ClientManager
- type ContractStorage
- type ParseCase
- func (pc *ParseCase) AddProtocol(ctx context.Context, sp entities.SwapProtocol) (err error)
- func (pc *ParseCase) Clear(ctx context.Context)
- func (pc *ParseCase) GetPairs(ctx context.Context) (p []entities.TokenPair, err error)
- func (pc *ParseCase) GetPools(ctx context.Context) (pools []entities.Pool, err error)
- func (pc *ParseCase) JustParse(ctx context.Context) (pools []entities.Pool, err error)
- func (pc *ParseCase) ParseAndStore(ctx context.Context) (err error)
- func (pc *ParseCase) ParsePairs(ctx context.Context, pairs []entities.TokenPair) (err error)
- func (pc *ParseCase) RmProtocol(ctx context.Context, sp entities.SwapProtocol) (err error)
- type ParseStore
- type Parser
- type PoolRepo
- type ProtocolManager
- type ProviderStorage
- type Repository
- type SmartContract
- type Storage
- type TokenRepo
- type TradeCase
- func (tc *TradeCase) AddBaseToken(ctx context.Context, address string) (tx interface{}, err error)
- func (tc *TradeCase) Arbitrage(ctx context.Context, pool0, pool1 string) (tx interface{}, err error)
- func (tc *TradeCase) GetProfit(ctx context.Context, pool0, pool1 string) (profit int, baseToken string, err error)
- func (tc *TradeCase) GetProfitable(ctx context.Context, from []entities.TradePair) (out []entities.TradePair, ok bool, err error)
- func (tc *TradeCase) ReplaceTxWithAddBaseToken(ctx context.Context, token, hash string) (tx interface{}, err error)
- func (tc *TradeCase) ReplaceTxWithRmBaseToken(ctx context.Context, token, hash string) (tx interface{}, err error)
- func (tc *TradeCase) RmBaseToken(ctx context.Context, address string) (tx interface{}, err error)
- func (tc *TradeCase) SetContract() (contract SmartContract)
- func (tc *TradeCase) SetProfitablePairs(ctx context.Context, where string) (err error)
- func (tc *TradeCase) SetProvider() (provider TradeProvider)
- func (tc *TradeCase) SetRepo() (repo Repository)
- func (tc *TradeCase) SetTokens(ctx context.Context, where string) (err error)
- func (tc *TradeCase) Withdraw(ctx context.Context) (tx interface{}, err error)
- type TradeProvider
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ClientManager ¶
type ContractStorage ¶
type ContractStorage interface { AddPair( c.Context, entities.TradePair, ) error RemovePair( c.Context, string, string, ) error GetPair( c.Context, string, string, ) (entities.TradePair, error) GetPairs( c.Context, entities.SwapProtocol, entities.TokenPair, ) ([]entities.TradePair, bool) SetPairs( c.Context, []entities.TradePair, ) error ListPairs(c.Context) []entities.TradePair ClearPairs(c.Context) }
type ParseCase ¶
type ParseCase struct { Parser Repository }
func NewParseCase ¶
func NewParseCase( repo Repository, parse Parser, ) ( pc ParseCase, )
func (*ParseCase) AddProtocol ¶
func (*ParseCase) ParseAndStore ¶
func (*ParseCase) ParsePairs ¶
func (*ParseCase) RmProtocol ¶
type ParseStore ¶
type Parser ¶
type Parser interface { Parse([]entities.TokenPair) error ParseStore ProtocolManager }
type PoolRepo ¶
type PoolRepo interface { ListPools( c.Context, string, ) ([]entities.Pool, error) StorePools( c.Context, string, []entities.Pool, ) error AddPool( c.Context, entities.Pool, string, ) error GetByTokens( c.Context, string, entities.TokenPair, ) ([]entities.Pool, error) RemovePool( c.Context, string, entities.Pool, ) error RemovePools( c.Context, string, []entities.Pool, ) ([]entities.Pool, error) }
type ProtocolManager ¶
type ProtocolManager interface { ListProtocols() []entities.SwapProtocol AddProtocol(entities.SwapProtocol) error RemoveProtocol(entities.SwapProtocol) error GetPoolAddresses(entities.TokenPair) (map[entities.SwapProtocol]string, error) }
type ProviderStorage ¶
type Repository ¶
type SmartContract ¶
type SmartContract interface { ContractStorage contract.Api }
type TokenRepo ¶
type TokenRepo interface { StoreTokens( c.Context, string, []entities.Token, ) error AddToken( c.Context, string, entities.Token, ) error ListTokens( c.Context, string, ) ([]entities.Token, error) GetTokenByAddress( c.Context, string, string, ) (entities.Token, error) RemoveToken( c.Context, string, entities.Token, ) error RemoveTokens( c.Context, string, []entities.Token, ) ([]entities.Token, error) }
type TradeCase ¶
type TradeCase struct { Repo Repository Provider TradeProvider Contract SmartContract }
func New ¶
func New( r Repository, p TradeProvider, c SmartContract, ) ( tc *TradeCase, )
func (*TradeCase) AddBaseToken ¶
func (*TradeCase) GetProfitable ¶
func (*TradeCase) ReplaceTxWithAddBaseToken ¶
func (*TradeCase) ReplaceTxWithRmBaseToken ¶
func (*TradeCase) RmBaseToken ¶
func (*TradeCase) SetContract ¶
func (tc *TradeCase) SetContract() ( contract SmartContract, )
func (*TradeCase) SetProfitablePairs ¶
func (*TradeCase) SetProvider ¶
func (tc *TradeCase) SetProvider() ( provider TradeProvider, )
func (*TradeCase) SetRepo ¶
func (tc *TradeCase) SetRepo() ( repo Repository, )
type TradeProvider ¶
type TradeProvider interface { ClientManager ProviderStorage }
Click to show internal directories.
Click to hide internal directories.