Versions in this module Expand all Collapse all v0 v0.4.0 Apr 25, 2019 Changes in this version + 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") + type AccountService struct + AccountDao interfaces.AccountDao + TokenDao interfaces.TokenDao + func NewAccountService(accountDao interfaces.AccountDao, tokenDao interfaces.TokenDao) *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 struct + func NewDepositService(configDao interfaces.ConfigDao, associationDao interfaces.AssociationDao, ...) *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 struct + OrderDao interfaces.OrderDao + PairDao interfaces.PairDao + TradeDao interfaces.TradeDao + func NewMarketsService(pairDao interfaces.PairDao, orderdao interfaces.OrderDao, ...) *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 struct + func NewOHLCVService(TradeDao interfaces.TradeDao) *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 struct + func NewOrderBookService(pairDao interfaces.PairDao, tokenDao interfaces.TokenDao, ...) *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 struct + func NewOrderService(orderDao interfaces.OrderDao, pairDao interfaces.PairDao, ...) *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 struct + func NewPairService(pairDao interfaces.PairDao, tokenDao interfaces.TokenDao, ...) *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 struct + PriceBoardDao interfaces.PriceBoardDao + TokenDao interfaces.TokenDao + TradeDao interfaces.TradeDao + func NewPriceBoardService(tokenDao interfaces.TokenDao, tradeDao interfaces.TradeDao, ...) *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 struct + func NewTokenService(tokenDao interfaces.TokenDao) *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 struct + func NewTradeService(TradeDao interfaces.TradeDao) *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 struct + Wallet *types.Wallet + WalletDao interfaces.WalletDao + func NewTxService(dao interfaces.WalletDao, w *types.Wallet) *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 struct + func NewValidatorService(ethereumProvider interfaces.EthereumProvider, accountDao interfaces.AccountDao, ...) *ValidatorService + func (s *ValidatorService) ValidateAvailableBalance(o *types.Order) error + func (s *ValidatorService) ValidateBalance(o *types.Order) error + type WalletService struct + WalletDao interfaces.WalletDao + func NewWalletService(walletDao interfaces.WalletDao) *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)