Documentation ¶
Index ¶
- Variables
- type AccountService
- func (s *AccountService) AddFavoriteToken(owner, token common.Address) error
- func (s *AccountService) Create(a *types.Account) error
- func (s *AccountService) DeleteFavoriteToken(owner, token common.Address) error
- func (s *AccountService) FindOrCreate(addr common.Address) (*types.Account, error)
- func (s *AccountService) GetAll() ([]types.Account, error)
- func (s *AccountService) GetByAddress(a common.Address) (*types.Account, error)
- func (s *AccountService) GetByID(id bson.ObjectId) (*types.Account, error)
- func (s *AccountService) GetFavoriteTokens(owner common.Address) (map[common.Address]bool, error)
- func (s *AccountService) GetTokenBalance(owner common.Address, token common.Address) (*types.TokenBalance, error)
- func (s *AccountService) GetTokenBalances(owner common.Address) (map[common.Address]*types.TokenBalance, error)
- func (s *AccountService) Transfer(token common.Address, fromAddress common.Address, toAddress common.Address, ...) error
- type DepositService
- func (s *DepositService) EthereumClient() interfaces.EthereumClient
- func (s *DepositService) GenerateAddress(chain types.Chain) (common.Address, uint64, error)
- func (s *DepositService) GetAssociationByChainAddress(chain types.Chain, userAddress common.Address) (*types.AddressAssociationRecord, error)
- func (s *DepositService) GetAssociationByChainAssociatedAddress(chain types.Chain, associatedAddress common.Address) (*types.AddressAssociationRecord, error)
- func (s *DepositService) GetBlockToProcess(chain types.Chain) (uint64, error)
- func (s *DepositService) GetSchemaVersion() uint64
- func (s *DepositService) MinimumValueSat() int64
- func (s *DepositService) MinimumValueWei() *big.Int
- func (s *DepositService) QueueAdd(transaction *types.DepositTransaction) error
- func (s *DepositService) QueuePool() (<-chan *types.DepositTransaction, error)
- func (s *DepositService) RecoveryTransaction(chain types.Chain, address common.Address) error
- func (s *DepositService) SaveAssociationByChainAddress(chain types.Chain, address common.Address, index uint64, ...) error
- func (s *DepositService) SaveAssociationStatusByChainAddress(addressAssociation *types.AddressAssociationRecord, status string) error
- func (s *DepositService) SaveDepositTransaction(chain types.Chain, sourceAccount common.Address, txEnvelope string) error
- func (s *DepositService) SaveLastProcessedBlock(chain types.Chain, block uint64) error
- func (s *DepositService) SetDelegate(handler interfaces.SwapEngineHandler)
- func (s *DepositService) SignerPublicKey() common.Address
- type MarketsService
- func (s *MarketsService) GetOHLCV(pairs []types.PairAddresses, duration int64, unit string, ...) ([]*types.Tick, error)
- func (s *MarketsService) GetPairData() ([]*types.PairData, error)
- func (s *MarketsService) GetSmallChartsData() (map[string][]*types.Tick, error)
- func (s *MarketsService) Subscribe(c *ws.Client)
- func (s *MarketsService) Unsubscribe(c *ws.Client)
- func (s *MarketsService) UnsubscribeChannel(c *ws.Client)
- type OHLCVService
- func (s *OHLCVService) GetOHLCV(pairs []types.PairAddresses, duration int64, unit string, ...) ([]*types.Tick, error)
- func (s *OHLCVService) Subscribe(conn *ws.Client, p *types.SubscriptionPayload)
- func (s *OHLCVService) Unsubscribe(conn *ws.Client)
- func (s *OHLCVService) UnsubscribeChannel(conn *ws.Client, p *types.SubscriptionPayload)
- type OrderBookService
- func (s *OrderBookService) GetOrderBook(bt, qt common.Address) (*types.OrderBook, error)
- func (s *OrderBookService) GetRawOrderBook(bt, qt common.Address) (*types.RawOrderBook, error)
- func (s *OrderBookService) SubscribeOrderBook(c *ws.Client, bt, qt common.Address)
- func (s *OrderBookService) SubscribeRawOrderBook(c *ws.Client, bt, qt common.Address)
- func (s *OrderBookService) UnsubscribeOrderBook(c *ws.Client)
- func (s *OrderBookService) UnsubscribeOrderBookChannel(c *ws.Client, bt, qt common.Address)
- func (s *OrderBookService) UnsubscribeRawOrderBook(c *ws.Client)
- func (s *OrderBookService) UnsubscribeRawOrderBookChannel(c *ws.Client, bt, qt common.Address)
- type OrderService
- func (s *OrderService) CancelOrder(oc *types.OrderCancel) error
- func (s *OrderService) GetByHash(hash common.Hash) (*types.Order, error)
- func (s *OrderService) GetByHashes(hashes []common.Hash) ([]*types.Order, error)
- func (s *OrderService) GetByID(id bson.ObjectId) (*types.Order, error)
- func (s *OrderService) GetByUserAddress(addr common.Address, limit ...int) ([]*types.Order, error)
- func (s *OrderService) GetCurrentByUserAddress(addr common.Address, limit ...int) ([]*types.Order, error)
- func (s *OrderService) GetHistoryByUserAddress(addr common.Address, limit ...int) ([]*types.Order, error)
- func (s *OrderService) HandleEngineResponse(res *types.EngineResponse) error
- func (s *OrderService) HandleOperatorMessages(msg *types.OperatorMessage) error
- func (s *OrderService) NewOrder(o *types.Order) error
- type PairService
- func (s *PairService) Create(pair *types.Pair) error
- func (s *PairService) CreatePairs(addr common.Address) ([]*types.Pair, error)
- func (s *PairService) GetAll() ([]types.Pair, error)
- func (s *PairService) GetAllTokenPairData() ([]*types.PairData, error)
- func (s *PairService) GetByID(id bson.ObjectId) (*types.Pair, error)
- func (s *PairService) GetByTokenAddress(bt, qt common.Address) (*types.Pair, error)
- func (s *PairService) GetListedPairs() ([]types.Pair, error)
- func (s *PairService) GetTokenPairData(bt, qt common.Address) ([]*types.Tick, error)
- func (s *PairService) GetUnlistedPairs() ([]types.Pair, error)
- type PriceBoardService
- func (s *PriceBoardService) GetPriceBoardData(pairs []types.PairAddresses, duration int64, unit string, ...) ([]*types.Tick, error)
- func (s *PriceBoardService) Subscribe(c *ws.Client, bt, qt common.Address)
- func (s *PriceBoardService) SyncFiatPrice()
- func (s *PriceBoardService) Unsubscribe(c *ws.Client)
- func (s *PriceBoardService) UnsubscribeChannel(c *ws.Client, bt, qt common.Address)
- type TokenService
- func (s *TokenService) Create(token *types.Token) error
- func (s *TokenService) GetAll() ([]types.Token, error)
- func (s *TokenService) GetBaseTokens() ([]types.Token, error)
- func (s *TokenService) GetByAddress(addr common.Address) (*types.Token, error)
- func (s *TokenService) GetByID(id bson.ObjectId) (*types.Token, error)
- func (s *TokenService) GetQuoteTokens() ([]types.Token, error)
- type TradeService
- func (s *TradeService) GetAllTradesByPairAddress(bt, qt common.Address) ([]*types.Trade, error)
- func (s *TradeService) GetByHash(h common.Hash) (*types.Trade, error)
- func (s *TradeService) GetByMakerOrderHash(h common.Hash) ([]*types.Trade, error)
- func (s *TradeService) GetByOrderHashes(hashes []common.Hash) ([]*types.Trade, error)
- func (s *TradeService) GetByPairName(p string) ([]*types.Trade, error)
- func (s *TradeService) GetByTakerOrderHash(h common.Hash) ([]*types.Trade, error)
- func (s *TradeService) GetByUserAddress(a common.Address) ([]*types.Trade, error)
- func (s *TradeService) GetSortedTrades(bt, qt common.Address, n int) ([]*types.Trade, error)
- func (s *TradeService) GetSortedTradesByUserAddress(a common.Address, limit ...int) ([]*types.Trade, error)
- func (s *TradeService) Subscribe(c *ws.Client, bt, qt common.Address)
- func (s *TradeService) Unsubscribe(c *ws.Client)
- func (s *TradeService) UnsubscribeChannel(c *ws.Client, bt, qt common.Address)
- func (s *TradeService) UpdatePendingTrade(t *types.Trade, txh common.Hash) (*types.Trade, error)
- func (s *TradeService) UpdateSuccessfulTrade(t *types.Trade) (*types.Trade, error)
- func (s *TradeService) UpdateTradeTxHash(tr *types.Trade, txh common.Hash) error
- type TxService
- func (s *TxService) GetCustomTxSendOptions(w *types.Wallet) *bind.TransactOpts
- func (s *TxService) GetTxCallOptions() *bind.CallOpts
- func (s *TxService) GetTxDefaultSendOptions() (*bind.TransactOpts, error)
- func (s *TxService) GetTxSendOptions() (*bind.TransactOpts, error)
- func (s *TxService) SetTxSender(w *types.Wallet)
- type ValidatorService
- type WalletService
- func (s *WalletService) CreateAdminWallet(a common.Address) (*types.Wallet, error)
- func (s *WalletService) GetAll() ([]types.Wallet, error)
- func (s *WalletService) GetByAddress(a common.Address) (*types.Wallet, error)
- func (s *WalletService) GetDefaultAdminWallet() (*types.Wallet, error)
- func (s *WalletService) GetOperatorAddresses() ([]common.Address, error)
- func (s *WalletService) GetOperatorWallets() ([]*types.Wallet, error)
Constants ¶
This section is empty.
Variables ¶
var ErrAccountExists = errors.New("Account already Exists")
var ErrAccountNotFound = errors.New("Account not found")
var ErrBaseTokenNotFound = errors.New("BaseToken not found")
var ErrNoContractCode = errors.New("Contract not found at given address")
var ErrPairExists = errors.New("Pairs already exists")
var ErrPairNotFound = errors.New("Pair not found")
var ErrQuoteTokenInvalid = errors.New("Quote Token Invalid (not a quote)")
var ErrQuoteTokenNotFound = errors.New("QuoteToken not found")
var ErrTokenExists = errors.New("Token already exists")
Functions ¶
This section is empty.
Types ¶
type AccountService ¶
type AccountService struct { AccountDao interfaces.AccountDao TokenDao interfaces.TokenDao }
func NewAccountService ¶
func NewAccountService( accountDao interfaces.AccountDao, tokenDao interfaces.TokenDao, ) *AccountService
NewAddressService returns a new instance of accountService
func (*AccountService) AddFavoriteToken ¶
func (s *AccountService) AddFavoriteToken(owner, token common.Address) error
func (*AccountService) DeleteFavoriteToken ¶
func (s *AccountService) DeleteFavoriteToken(owner, token common.Address) error
func (*AccountService) FindOrCreate ¶
func (*AccountService) GetByAddress ¶
func (*AccountService) GetFavoriteTokens ¶
func (*AccountService) GetTokenBalance ¶
func (s *AccountService) GetTokenBalance(owner common.Address, token common.Address) (*types.TokenBalance, error)
func (*AccountService) GetTokenBalances ¶
func (s *AccountService) GetTokenBalances(owner common.Address) (map[common.Address]*types.TokenBalance, error)
type DepositService ¶
type DepositService struct {
// contains filtered or unexported fields
}
need to refractor using interface.SwappEngine and only expose neccessary methods
func NewDepositService ¶
func NewDepositService( configDao interfaces.ConfigDao, associationDao interfaces.AssociationDao, pairDao interfaces.PairDao, orderDao interfaces.OrderDao, swapEngine *swap.Engine, engine interfaces.Engine, broker *rabbitmq.Connection, ) *DepositService
NewAddressService returns a new instance of accountService
func (*DepositService) EthereumClient ¶
func (s *DepositService) EthereumClient() interfaces.EthereumClient
func (*DepositService) GenerateAddress ¶
func (*DepositService) GetAssociationByChainAddress ¶
func (s *DepositService) GetAssociationByChainAddress(chain types.Chain, userAddress common.Address) (*types.AddressAssociationRecord, error)
func (*DepositService) GetAssociationByChainAssociatedAddress ¶
func (s *DepositService) GetAssociationByChainAssociatedAddress(chain types.Chain, associatedAddress common.Address) (*types.AddressAssociationRecord, error)
func (*DepositService) GetBlockToProcess ¶
func (s *DepositService) GetBlockToProcess(chain types.Chain) (uint64, error)
**** implement Storage interface **
func (*DepositService) GetSchemaVersion ¶
func (s *DepositService) GetSchemaVersion() uint64
func (*DepositService) MinimumValueSat ¶
func (s *DepositService) MinimumValueSat() int64
func (*DepositService) MinimumValueWei ¶
func (s *DepositService) MinimumValueWei() *big.Int
func (*DepositService) QueueAdd ¶
func (s *DepositService) QueueAdd(transaction *types.DepositTransaction) error
func (*DepositService) QueuePool ¶
func (s *DepositService) QueuePool() (<-chan *types.DepositTransaction, error)
QueuePool receives and removes the head of this queue. Returns nil if no elements found.
func (*DepositService) RecoveryTransaction ¶
func (*DepositService) SaveAssociationByChainAddress ¶
func (*DepositService) SaveAssociationStatusByChainAddress ¶
func (s *DepositService) SaveAssociationStatusByChainAddress(addressAssociation *types.AddressAssociationRecord, status string) error
func (*DepositService) SaveDepositTransaction ¶
func (*DepositService) SaveLastProcessedBlock ¶
func (s *DepositService) SaveLastProcessedBlock(chain types.Chain, block uint64) error
func (*DepositService) SetDelegate ¶
func (s *DepositService) SetDelegate(handler interfaces.SwapEngineHandler)
func (*DepositService) SignerPublicKey ¶
func (s *DepositService) SignerPublicKey() common.Address
type MarketsService ¶
type MarketsService struct { PairDao interfaces.PairDao OrderDao interfaces.OrderDao TradeDao interfaces.TradeDao }
MarketsService struct with daos required, responsible for communicating with daos. MarketsService functions are responsible for interacting with daos and implements business logics.
func NewMarketsService ¶
func NewMarketsService( pairDao interfaces.PairDao, orderdao interfaces.OrderDao, tradeDao interfaces.TradeDao, ) *MarketsService
NewTradeService returns a new instance of TradeService
func (*MarketsService) GetOHLCV ¶
func (s *MarketsService) GetOHLCV(pairs []types.PairAddresses, duration int64, unit string, timeInterval ...int64) ([]*types.Tick, error)
TODO: Refactor this somehow, it's duplicated in OHLCVService GetOHLCV fetches OHLCV data using pairName: can be "" for fetching data for all pairs duration: in integer unit: sec,min,hour,day,week,month,yr timeInterval: 0-2 entries (0 argument: latest data,1st argument: from timestamp, 2nd argument: to timestamp)
func (*MarketsService) GetPairData ¶
func (s *MarketsService) GetPairData() ([]*types.PairData, error)
func (*MarketsService) GetSmallChartsData ¶
func (s *MarketsService) GetSmallChartsData() (map[string][]*types.Tick, error)
func (*MarketsService) UnsubscribeChannel ¶
func (s *MarketsService) UnsubscribeChannel(c *ws.Client)
Unsubscribe
type OHLCVService ¶
type OHLCVService struct {
// contains filtered or unexported fields
}
func NewOHLCVService ¶
func NewOHLCVService(TradeDao interfaces.TradeDao) *OHLCVService
func (*OHLCVService) GetOHLCV ¶
func (s *OHLCVService) GetOHLCV(pairs []types.PairAddresses, duration int64, unit string, timeInterval ...int64) ([]*types.Tick, error)
GetOHLCV fetches OHLCV data using pairName: can be "" for fetching data for all pairs duration: in integer unit: sec,min,hour,day,week,month,yr timeInterval: 0-2 entries (0 argument: latest data,1st argument: from timestamp, 2nd argument: to timestamp)
func (*OHLCVService) Subscribe ¶
func (s *OHLCVService) Subscribe(conn *ws.Client, p *types.SubscriptionPayload)
Subscribe handles all the subscription messages for ticks corresponding to a pair It calls the corresponding channel's subscription method and sends trade history back on the connection
func (*OHLCVService) Unsubscribe ¶
func (s *OHLCVService) Unsubscribe(conn *ws.Client)
Unsubscribe handles all the unsubscription messages for ticks corresponding to a pair
func (*OHLCVService) UnsubscribeChannel ¶
func (s *OHLCVService) UnsubscribeChannel(conn *ws.Client, p *types.SubscriptionPayload)
Unsubscribe handles all the unsubscription messages for ticks corresponding to a pair
type OrderBookService ¶
type OrderBookService struct {
// contains filtered or unexported fields
}
PairService struct with daos required, responsible for communicating with daos. PairService functions are responsible for interacting with daos and implements business logics.
func NewOrderBookService ¶
func NewOrderBookService( pairDao interfaces.PairDao, tokenDao interfaces.TokenDao, orderDao interfaces.OrderDao, eng interfaces.Engine, ) *OrderBookService
NewPairService returns a new instance of balance service
func (*OrderBookService) GetOrderBook ¶
GetOrderBook fetches orderbook from engine and returns it as an map[string]interface
func (*OrderBookService) GetRawOrderBook ¶
func (s *OrderBookService) GetRawOrderBook(bt, qt common.Address) (*types.RawOrderBook, error)
GetRawOrderBook fetches complete orderbook from engine
func (*OrderBookService) SubscribeOrderBook ¶
func (s *OrderBookService) SubscribeOrderBook(c *ws.Client, bt, qt common.Address)
SubscribeOrderBook is responsible for handling incoming orderbook subscription messages It makes an entry of connection in pairSocket corresponding to pair,unit and duration
func (*OrderBookService) SubscribeRawOrderBook ¶
func (s *OrderBookService) SubscribeRawOrderBook(c *ws.Client, bt, qt common.Address)
SubscribeRawOrderBook is responsible for handling incoming orderbook subscription messages It makes an entry of connection in pairSocket corresponding to pair,unit and duration
func (*OrderBookService) UnsubscribeOrderBook ¶
func (s *OrderBookService) UnsubscribeOrderBook(c *ws.Client)
UnsubscribeOrderBook is responsible for handling incoming orderbook unsubscription messages
func (*OrderBookService) UnsubscribeOrderBookChannel ¶
func (s *OrderBookService) UnsubscribeOrderBookChannel(c *ws.Client, bt, qt common.Address)
func (*OrderBookService) UnsubscribeRawOrderBook ¶
func (s *OrderBookService) UnsubscribeRawOrderBook(c *ws.Client)
UnsubscribeRawOrderBook is responsible for handling incoming orderbook unsubscription messages
func (*OrderBookService) UnsubscribeRawOrderBookChannel ¶
func (s *OrderBookService) UnsubscribeRawOrderBookChannel(c *ws.Client, bt, qt common.Address)
type OrderService ¶
type OrderService struct {
// contains filtered or unexported fields
}
OrderService
func NewOrderService ¶
func NewOrderService( orderDao interfaces.OrderDao, pairDao interfaces.PairDao, accountDao interfaces.AccountDao, tradeDao interfaces.TradeDao, engine interfaces.Engine, validator interfaces.ValidatorService, broker *rabbitmq.Connection, ) *OrderService
NewOrderService returns a new instance of orderservice
func (*OrderService) CancelOrder ¶
func (s *OrderService) CancelOrder(oc *types.OrderCancel) error
CancelOrder handles the cancellation order requests. Only Orders which are OPEN or NEW i.e. Not yet filled/partially filled can be cancelled
func (*OrderService) GetByHashes ¶
func (*OrderService) GetByUserAddress ¶
GetByUserAddress fetches all the orders placed by passed user address
func (*OrderService) GetCurrentByUserAddress ¶
func (s *OrderService) GetCurrentByUserAddress(addr common.Address, limit ...int) ([]*types.Order, error)
GetCurrentByUserAddress function fetches list of open/partial orders from order collection based on user address. Returns array of Order type struct
func (*OrderService) GetHistoryByUserAddress ¶
func (s *OrderService) GetHistoryByUserAddress(addr common.Address, limit ...int) ([]*types.Order, error)
GetHistoryByUserAddress function fetches list of orders which are not in open/partial order status from order collection based on user address. Returns array of Order type struct
func (*OrderService) HandleEngineResponse ¶
func (s *OrderService) HandleEngineResponse(res *types.EngineResponse) error
HandleEngineResponse listens to messages incoming from the engine and handles websocket responses and database updates accordingly
func (*OrderService) HandleOperatorMessages ¶
func (s *OrderService) HandleOperatorMessages(msg *types.OperatorMessage) error
func (*OrderService) NewOrder ¶
func (s *OrderService) NewOrder(o *types.Order) error
NewOrder validates if the passed order is valid or not based on user's available funds and order data. If valid: Order is inserted in DB with order status as new and order is publiched on rabbitmq queue for matching engine to process the order
type PairService ¶
type PairService struct {
// contains filtered or unexported fields
}
PairService struct with daos required, responsible for communicating with daos. PairService functions are responsible for interacting with daos and implements business logics.
func NewPairService ¶
func NewPairService( pairDao interfaces.PairDao, tokenDao interfaces.TokenDao, tradeDao interfaces.TradeDao, orderDao interfaces.OrderDao, eng interfaces.Engine, provider interfaces.EthereumProvider, ) *PairService
NewPairService returns a new instance of balance service
func (*PairService) Create ¶
func (s *PairService) Create(pair *types.Pair) error
Create function is responsible for inserting new pair in DB. It checks for existence of tokens in DB first
func (*PairService) CreatePairs ¶
func (*PairService) GetAll ¶
func (s *PairService) GetAll() ([]types.Pair, error)
GetAll is reponsible for fetching all the pairs in the DB
func (*PairService) GetAllTokenPairData ¶
func (s *PairService) GetAllTokenPairData() ([]*types.PairData, error)
func (*PairService) GetByTokenAddress ¶
GetByTokenAddress fetches details of a pair using contract address of its constituting tokens
func (*PairService) GetListedPairs ¶
func (s *PairService) GetListedPairs() ([]types.Pair, error)
func (*PairService) GetTokenPairData ¶
func (*PairService) GetUnlistedPairs ¶
func (s *PairService) GetUnlistedPairs() ([]types.Pair, error)
type PriceBoardService ¶
type PriceBoardService struct { TokenDao interfaces.TokenDao TradeDao interfaces.TradeDao PriceBoardDao interfaces.PriceBoardDao }
TradeService struct with daos required, responsible for communicating with daos. TradeService functions are responsible for interacting with daos and implements business logics.
func NewPriceBoardService ¶
func NewPriceBoardService( tokenDao interfaces.TokenDao, tradeDao interfaces.TradeDao, priceBoardDao interfaces.PriceBoardDao, ) *PriceBoardService
NewTradeService returns a new instance of TradeService
func (*PriceBoardService) GetPriceBoardData ¶
func (s *PriceBoardService) GetPriceBoardData(pairs []types.PairAddresses, duration int64, unit string, timeInterval ...int64) ([]*types.Tick, error)
func (*PriceBoardService) Subscribe ¶
func (s *PriceBoardService) Subscribe(c *ws.Client, bt, qt common.Address)
Subscribe
func (*PriceBoardService) SyncFiatPrice ¶
func (s *PriceBoardService) SyncFiatPrice()
func (*PriceBoardService) Unsubscribe ¶
func (s *PriceBoardService) Unsubscribe(c *ws.Client)
Unsubscribe
func (*PriceBoardService) UnsubscribeChannel ¶
func (s *PriceBoardService) UnsubscribeChannel(c *ws.Client, bt, qt common.Address)
Unsubscribe
type TokenService ¶
type TokenService struct {
// contains filtered or unexported fields
}
TokenService struct with daos required, responsible for communicating with daos. TokenService functions are responsible for interacting with daos and implements business logics.
func NewTokenService ¶
func NewTokenService(tokenDao interfaces.TokenDao) *TokenService
NewTokenService returns a new instance of TokenService
func (*TokenService) Create ¶
func (s *TokenService) Create(token *types.Token) error
Create inserts a new token into the database
func (*TokenService) GetAll ¶
func (s *TokenService) GetAll() ([]types.Token, error)
GetAll fetches all the tokens from db
func (*TokenService) GetBaseTokens ¶
func (s *TokenService) GetBaseTokens() ([]types.Token, error)
GetBase fetches all the quote tokens from db
func (*TokenService) GetByAddress ¶
GetByAddress fetches the detailed document of a token using its contract address
func (*TokenService) GetQuoteTokens ¶
func (s *TokenService) GetQuoteTokens() ([]types.Token, error)
GetQuote fetches all the quote tokens from db
type TradeService ¶
type TradeService struct {
// contains filtered or unexported fields
}
TradeService struct with daos required, responsible for communicating with daos. TradeService functions are responsible for interacting with daos and implements business logics.
func NewTradeService ¶
func NewTradeService(TradeDao interfaces.TradeDao) *TradeService
NewTradeService returns a new instance of TradeService
func (*TradeService) GetAllTradesByPairAddress ¶
GetByPairAddress fetches all the trades corresponding to a pair using pair's token address
func (*TradeService) GetByMakerOrderHash ¶
func (*TradeService) GetByOrderHashes ¶
func (*TradeService) GetByPairName ¶
func (s *TradeService) GetByPairName(p string) ([]*types.Trade, error)
GetByPairName fetches all the trades corresponding to a pair using pair's name
func (*TradeService) GetByTakerOrderHash ¶
func (*TradeService) GetByUserAddress ¶
GetByUserAddress fetches all the trades corresponding to a user address
func (*TradeService) GetSortedTrades ¶
func (*TradeService) GetSortedTradesByUserAddress ¶
func (*TradeService) Subscribe ¶
func (s *TradeService) Subscribe(c *ws.Client, bt, qt common.Address)
Subscribe
func (*TradeService) UnsubscribeChannel ¶
func (s *TradeService) UnsubscribeChannel(c *ws.Client, bt, qt common.Address)
Unsubscribe
func (*TradeService) UpdatePendingTrade ¶
func (*TradeService) UpdateSuccessfulTrade ¶
func (*TradeService) UpdateTradeTxHash ¶
type TxService ¶
type TxService struct { WalletDao interfaces.WalletDao Wallet *types.Wallet }
WalletService struct with daos required, responsible for communicating with daos
func NewTxService ¶
func NewTxService(dao interfaces.WalletDao, w *types.Wallet) *TxService
func (*TxService) GetCustomTxSendOptions ¶
func (s *TxService) GetCustomTxSendOptions(w *types.Wallet) *bind.TransactOpts
func (*TxService) GetTxCallOptions ¶
func (*TxService) GetTxDefaultSendOptions ¶
func (s *TxService) GetTxDefaultSendOptions() (*bind.TransactOpts, error)
func (*TxService) GetTxSendOptions ¶
func (s *TxService) GetTxSendOptions() (*bind.TransactOpts, error)
func (*TxService) SetTxSender ¶
type ValidatorService ¶
type ValidatorService struct {
// contains filtered or unexported fields
}
func NewValidatorService ¶
func NewValidatorService( ethereumProvider interfaces.EthereumProvider, accountDao interfaces.AccountDao, orderDao interfaces.OrderDao, pairDao interfaces.PairDao, ) *ValidatorService
func (*ValidatorService) ValidateAvailableBalance ¶
func (s *ValidatorService) ValidateAvailableBalance(o *types.Order) error
func (*ValidatorService) ValidateBalance ¶
func (s *ValidatorService) ValidateBalance(o *types.Order) error
type WalletService ¶
type WalletService struct {
WalletDao interfaces.WalletDao
}
WalletService struct with daos required, responsible for communicating with daos
func NewWalletService ¶
func NewWalletService(walletDao interfaces.WalletDao) *WalletService
func (*WalletService) CreateAdminWallet ¶
func (*WalletService) GetByAddress ¶
func (*WalletService) GetDefaultAdminWallet ¶
func (s *WalletService) GetDefaultAdminWallet() (*types.Wallet, error)
func (*WalletService) GetOperatorAddresses ¶
func (s *WalletService) GetOperatorAddresses() ([]common.Address, error)
func (*WalletService) GetOperatorWallets ¶
func (s *WalletService) GetOperatorWallets() ([]*types.Wallet, error)