Documentation ¶
Index ¶
- Constants
- Variables
- func GetPow(v uint8, r types.Bytes32, s types.Bytes32, powNonce uint64) *big.Int
- func HandleInputOrder(input eventemitter.EventData) (orderHash string, err error)
- func HandleOrder(input eventemitter.EventData) error
- func Initialize(filterOptions *config.GatewayFiltersOptions, options *config.GateWayOptions, ...)
- func Uint64ToByteArray(src uint64) []byte
- type AccountJson
- type AskBid
- type BaseFilter
- type BusinessType
- type CommonTokenRequest
- type CutoffFilter
- type CutoffRequest
- type Depth
- type DepthElement
- type DepthQuery
- type EstimatedAllocatedAllowanceQuery
- type EthForwarder
- func (e *EthForwarder) Call(ethCall *ethaccessor.CallArg, blockNumber string) (result string, err error)
- func (e *EthForwarder) GetBalance(address, blockNumber string) (result string, err error)
- func (e *EthForwarder) GetTransactionCount(address, blockNumber string) (result string, err error)
- func (e *EthForwarder) SendRawTransaction(tx string) (result string, err error)
- type FillQuery
- type Filter
- type Gateway
- type IPFSPubService
- type IPFSPubServiceImpl
- type IPFSSubService
- type IPFSSubServiceImpl
- type InvokeInfo
- type JsonrpcService
- type JsonrpcServiceImpl
- type LatestFill
- type OrderJsonResult
- type OrderQuery
- type P2PRingRequest
- type PageResult
- type Portfolio
- type PowFilter
- type PriceQuote
- type PriceQuoteQuery
- type RawOrderJsonResult
- type RingMinedDetail
- type RingMinedInfo
- type RingMinedQuery
- type Server
- type SignFilter
- type SingleDelegateAddress
- type SingleMarket
- type SingleOwner
- type SocketClient
- type SocketIOJsonResp
- type SocketIOService
- type SocketIOServiceImpl
- type SocketNode
- type Token
- type TokenFilter
- type TokenPrice
- type TransactionQuery
- type TrendQuery
- type TxNotify
- type WalletServiceImpl
- func (w *WalletServiceImpl) GetBalance(balanceQuery CommonTokenRequest) (res AccountJson, err error)
- func (w *WalletServiceImpl) GetContracts() (contracts map[string][]string, err error)
- func (w *WalletServiceImpl) GetCutoff(query CutoffRequest) (result int64, err error)
- func (w *WalletServiceImpl) GetDepth(query DepthQuery) (res Depth, err error)
- func (w *WalletServiceImpl) GetEstimateGasPrice() (result string, err error)
- func (w *WalletServiceImpl) GetEstimatedAllocatedAllowance(query EstimatedAllocatedAllowanceQuery) (frozenAmount string, err error)
- func (w *WalletServiceImpl) GetFills(query FillQuery) (dao.PageResult, error)
- func (w *WalletServiceImpl) GetFrozenLRCFee(query SingleOwner) (frozenAmount string, err error)
- func (w *WalletServiceImpl) GetLatestFills(query FillQuery) ([]LatestFill, error)
- func (w *WalletServiceImpl) GetLooprSupportedMarket() (markets []string, err error)
- func (w *WalletServiceImpl) GetLooprSupportedTokens() (markets []types.Token, err error)
- func (w *WalletServiceImpl) GetOldVersionWethBalance(owner SingleOwner) (res string, err error)
- func (w *WalletServiceImpl) GetOrderByHash(query OrderQuery) (order OrderJsonResult, err error)
- func (w *WalletServiceImpl) GetOrders(query *OrderQuery) (res PageResult, err error)
- func (w *WalletServiceImpl) GetPendingRawTxByHash(query TransactionQuery) (result TxNotify, err error)
- func (w *WalletServiceImpl) GetPendingTransactions(query SingleOwner) (result []txtyp.TransactionJsonResult, err error)
- func (w *WalletServiceImpl) GetPortfolio(query SingleOwner) (res []Portfolio, err error)
- func (w *WalletServiceImpl) GetPriceQuote(query PriceQuoteQuery) (result PriceQuote, err error)
- func (w *WalletServiceImpl) GetRingMined(query RingMinedQuery) (res dao.PageResult, err error)
- func (w *WalletServiceImpl) GetRingMinedDetail(query RingMinedQuery) (res RingMinedDetail, err error)
- func (w *WalletServiceImpl) GetSupportedMarket() (markets []string, err error)
- func (w *WalletServiceImpl) GetSupportedTokens() (markets []types.Token, err error)
- func (w *WalletServiceImpl) GetTicker() (res []market.Ticker, err error)
- func (w *WalletServiceImpl) GetTickers(mkt SingleMarket) (result map[string]market.Ticker, err error)
- func (w *WalletServiceImpl) GetTransactions(query TransactionQuery) (PageResult, error)
- func (w *WalletServiceImpl) GetTransactionsByHash(query TransactionQuery) (result []txtyp.TransactionJsonResult, err error)
- func (w *WalletServiceImpl) GetTrend(query TrendQuery) (res []market.Trend, err error)
- func (w *WalletServiceImpl) NotifyTransactionSubmitted(txNotify TxNotify) (result string, err error)
- func (w *WalletServiceImpl) SubmitOrder(order *types.OrderJsonRequest) (res string, err error)
- func (w *WalletServiceImpl) SubmitRingForP2P(p2pRing P2PRingRequest) (res string, err error)
- func (w *WalletServiceImpl) TestPing(input int) (resp []byte, err error)
- func (w *WalletServiceImpl) UnlockWallet(owner SingleOwner) (result string, err error)
- type WebsocketRequest
- type WebsocketService
- type WebsocketServiceImpl
Constants ¶
View Source
const ( EventPostfixReq = "_req" EventPostfixRes = "_res" EventPostfixEnd = "_end" DefaultCronSpec3Second = "0/3 * * * * *" DefaultCronSpec5Second = "0/5 * * * * *" DefaultCronSpec10Second = "0/10 * * * * *" DefaultCronSpec5Minute = "0 */5 * * * *" )
View Source
const DefaultCapCurrency = "CNY"
View Source
const P2P_50001 = "50001"
View Source
const P2P_50002 = "50002"
View Source
const P2P_50003 = "50003"
View Source
const P2P_50004 = "50004"
View Source
const P2P_50005 = "50005"
View Source
const P2P_50006 = "50006"
View Source
const P2P_50008 = "50008"
View Source
const PendingTxPreKey = "PENDING_TX_"
View Source
const SYS_10001 = "10001"
Variables ¶
View Source
var EventTypeRoute = map[string]InvokeInfo{ // contains filtered or unexported fields }
Functions ¶
func HandleInputOrder ¶
func HandleOrder ¶
func HandleOrder(input eventemitter.EventData) error
func Initialize ¶
func Initialize(filterOptions *config.GatewayFiltersOptions, options *config.GateWayOptions, ipfsOptions *config.IpfsOptions, om ordermanager.OrderManager, marketCap marketcap.MarketCapProvider, am market.AccountManager)
func Uint64ToByteArray ¶
Types ¶
type AccountJson ¶
type BaseFilter ¶
type BusinessType ¶
type BusinessType int
type CommonTokenRequest ¶
type CutoffFilter ¶
type CutoffFilter struct {
// contains filtered or unexported fields
}
type CutoffRequest ¶
type DepthElement ¶
type DepthQuery ¶
type EthForwarder ¶
type EthForwarder struct { }
func (*EthForwarder) Call ¶
func (e *EthForwarder) Call(ethCall *ethaccessor.CallArg, blockNumber string) (result string, err error)
func (*EthForwarder) GetBalance ¶
func (e *EthForwarder) GetBalance(address, blockNumber string) (result string, err error)
func (*EthForwarder) GetTransactionCount ¶
func (e *EthForwarder) GetTransactionCount(address, blockNumber string) (result string, err error)
func (*EthForwarder) SendRawTransaction ¶
func (e *EthForwarder) SendRawTransaction(tx string) (result string, err error)
type FillQuery ¶
type FillQuery struct { DelegateAddress string `json:"delegateAddress"` Market string `json:"market"` Owner string `json:"owner"` OrderHash string `json:"orderHash"` RingHash string `json:"ringHash"` PageIndex int `json:"pageIndex"` PageSize int `json:"pageSize"` Side string `json:"side"` OrderType string `json:"orderType"` }
type IPFSPubService ¶
type IPFSPubServiceImpl ¶
type IPFSPubServiceImpl struct {
// contains filtered or unexported fields
}
func NewIPFSPubService ¶
func NewIPFSPubService(options *config.IpfsOptions) *IPFSPubServiceImpl
func (*IPFSPubServiceImpl) PublishOrder ¶
func (p *IPFSPubServiceImpl) PublishOrder(order types.Order) error
type IPFSSubService ¶
type IPFSSubService interface { // Register register topic in options and start ipfs sub client Register(topic string) error // Unregister unregister topic from options and stop ipfs sub client Unregister(topic string) error // Start default start ipfs sub client Start() // Stop Stop() // Restart Restart() }
type IPFSSubServiceImpl ¶
type IPFSSubServiceImpl struct {
// contains filtered or unexported fields
}
func NewIPFSSubService ¶
func NewIPFSSubService(options config.IpfsOptions) *IPFSSubServiceImpl
func (*IPFSSubServiceImpl) Register ¶
func (l *IPFSSubServiceImpl) Register(topic string) error
func (*IPFSSubServiceImpl) Restart ¶
func (l *IPFSSubServiceImpl) Restart()
func (*IPFSSubServiceImpl) Start ¶
func (l *IPFSSubServiceImpl) Start()
func (*IPFSSubServiceImpl) Stop ¶
func (l *IPFSSubServiceImpl) Stop()
func (*IPFSSubServiceImpl) Unregister ¶
func (l *IPFSSubServiceImpl) Unregister(topic string) error
type InvokeInfo ¶
type InvokeInfo struct { MethodName string Query interface{} // contains filtered or unexported fields }
type JsonrpcService ¶
type JsonrpcService interface { Start(port string) Stop() }
type JsonrpcServiceImpl ¶
type JsonrpcServiceImpl struct {
// contains filtered or unexported fields
}
func NewJsonrpcService ¶
func NewJsonrpcService(port string, walletService *WalletServiceImpl) *JsonrpcServiceImpl
func (*JsonrpcServiceImpl) Ping ¶
func (*JsonrpcServiceImpl) Ping(val string, val2 int) (res string, err error)
func (*JsonrpcServiceImpl) Start ¶
func (j *JsonrpcServiceImpl) Start()
type LatestFill ¶
type OrderJsonResult ¶
type OrderQuery ¶
type OrderQuery struct { Status string `json:"status"` PageIndex int `json:"pageIndex"` PageSize int `json:"pageSize"` DelegateAddress string `json:"delegateAddress"` Owner string `json:"owner"` Market string `json:"market"` OrderHash string `json:"orderHash"` Side string `json:"side"` OrderType string `json:"orderType"` }
type P2PRingRequest ¶
type PageResult ¶
type PriceQuote ¶
type PriceQuote struct { Currency string `json:"currency"` Tokens []TokenPrice `json:"tokens"` }
type PriceQuoteQuery ¶
type PriceQuoteQuery struct {
Currency string `json:"currency"`
}
type RawOrderJsonResult ¶
type RawOrderJsonResult struct { Protocol string `json:"protocol"` // 智能合约地址 DelegateAddress string `json:"delegateAddress"` // 智能合约地址 Owner string `json:"address"` Hash string `json:"hash"` TokenS string `json:"tokenS"` // 卖出erc20代币智能合约地址 TokenB string `json:"tokenB"` // 买入erc20代币智能合约地址 AmountS string `json:"amountS"` // 卖出erc20代币数量上限 AmountB string `json:"amountB"` // 买入erc20代币数量上限 ValidSince string `json:"validSince"` ValidUntil string `json:"validUntil"` // 订单过期时间 //Salt string `json:"salt"` LrcFee string `json:"lrcFee"` // 交易总费用,部分成交的费用按该次撮合实际卖出代币额与比例计算 BuyNoMoreThanAmountB bool `json:"buyNoMoreThanAmountB"` MarginSplitPercentage string `json:"marginSplitPercentage"` // 不为0时支付给交易所的分润比例,否则视为100% V string `json:"v"` R string `json:"r"` S string `json:"s"` WalletAddress string `json:"walletAddress" gencodec:"required"` AuthAddr string `json:"authAddr" gencodec:"required"` // AuthPrivateKey string `json:"authPrivateKey" gencodec:"required"` // Market string `json:"market"` Side string `json:"side"` CreateTime int64 `json:"createTime"` OrderType string `json:"orderType"` }
type RingMinedDetail ¶
type RingMinedDetail struct { RingInfo RingMinedInfo `json:"ringInfo"` Fills []dao.FillEvent `json:"fills"` }
type RingMinedInfo ¶
type RingMinedInfo struct { ID int `json:"id"` Protocol string `json:"protocol"` DelegateAddress string `json:"delegateAddress"` RingIndex string `json:"ringIndex"` RingHash string `json:"ringHash"` TxHash string `json:"txHash"` Miner string `json:"miner"` FeeRecipient string `json:"feeRecipient"` IsRinghashReserved bool `json:"isRinghashReserved"` BlockNumber int64 `json:"blockNumber"` TotalLrcFee string `json:"totalLrcFee"` TotalSplitFee map[string]*big.Int `json:"totalSplitFee"` TradeAmount int `json:"tradeAmount"` Time int64 `json:"timestamp"` }
type RingMinedQuery ¶
type SignFilter ¶
type SignFilter struct { }
type SingleDelegateAddress ¶
type SingleDelegateAddress struct {
DelegateAddress string `json:"delegateAddress"`
}
type SingleMarket ¶
type SingleMarket struct {
Market string `json:"market"`
}
type SingleOwner ¶
type SingleOwner struct {
Owner string `json:"owner"`
}
type SocketClient ¶
type SocketClient struct {
// contains filtered or unexported fields
}
type SocketIOJsonResp ¶
type SocketIOService ¶
type SocketIOService interface { Start(port string) Stop() }
type SocketIOServiceImpl ¶
type SocketIOServiceImpl struct {
// contains filtered or unexported fields
}
func NewSocketIOService ¶
func NewSocketIOService(port string, walletService WalletServiceImpl) *SocketIOServiceImpl
func (*SocketIOServiceImpl) EmitNowByEventType ¶
func (so *SocketIOServiceImpl) EmitNowByEventType(bk string, v socketio.Conn, bv string)
func (*SocketIOServiceImpl) Start ¶
func (so *SocketIOServiceImpl) Start()
type SocketNode ¶
type SocketNode struct {
// contains filtered or unexported fields
}
type TokenFilter ¶
type TokenPrice ¶
type TransactionQuery ¶
type TrendQuery ¶
type TxNotify ¶
type TxNotify struct { Hash string `json:"hash"` Nonce string `json:"nonce"` From string `json:"from"` To string `json:"to"` Value string `json:"value"` GasPrice string `json:"gasPrice"` Gas string `json:"gas"` Input string `json:"input"` R string `json:"r"` S string `json:"s"` V string `json:"v"` }
type WalletServiceImpl ¶
type WalletServiceImpl struct {
// contains filtered or unexported fields
}
func NewWalletService ¶
func NewWalletService(trendManager market.TrendManager, orderManager ordermanager.OrderManager, accountManager market.AccountManager, capProvider marketcap.MarketCapProvider, collector market.CollectorImpl, rds dao.RdsService, oldWethAddress string) *WalletServiceImpl
func (*WalletServiceImpl) GetBalance ¶
func (w *WalletServiceImpl) GetBalance(balanceQuery CommonTokenRequest) (res AccountJson, err error)
func (*WalletServiceImpl) GetContracts ¶
func (w *WalletServiceImpl) GetContracts() (contracts map[string][]string, err error)
func (*WalletServiceImpl) GetCutoff ¶
func (w *WalletServiceImpl) GetCutoff(query CutoffRequest) (result int64, err error)
func (*WalletServiceImpl) GetDepth ¶
func (w *WalletServiceImpl) GetDepth(query DepthQuery) (res Depth, err error)
func (*WalletServiceImpl) GetEstimateGasPrice ¶
func (w *WalletServiceImpl) GetEstimateGasPrice() (result string, err error)
func (*WalletServiceImpl) GetEstimatedAllocatedAllowance ¶
func (w *WalletServiceImpl) GetEstimatedAllocatedAllowance(query EstimatedAllocatedAllowanceQuery) (frozenAmount string, err error)
func (*WalletServiceImpl) GetFills ¶
func (w *WalletServiceImpl) GetFills(query FillQuery) (dao.PageResult, error)
func (*WalletServiceImpl) GetFrozenLRCFee ¶
func (w *WalletServiceImpl) GetFrozenLRCFee(query SingleOwner) (frozenAmount string, err error)
func (*WalletServiceImpl) GetLatestFills ¶
func (w *WalletServiceImpl) GetLatestFills(query FillQuery) ([]LatestFill, error)
func (*WalletServiceImpl) GetLooprSupportedMarket ¶
func (w *WalletServiceImpl) GetLooprSupportedMarket() (markets []string, err error)
func (*WalletServiceImpl) GetLooprSupportedTokens ¶
func (w *WalletServiceImpl) GetLooprSupportedTokens() (markets []types.Token, err error)
func (*WalletServiceImpl) GetOldVersionWethBalance ¶
func (w *WalletServiceImpl) GetOldVersionWethBalance(owner SingleOwner) (res string, err error)
func (*WalletServiceImpl) GetOrderByHash ¶
func (w *WalletServiceImpl) GetOrderByHash(query OrderQuery) (order OrderJsonResult, err error)
func (*WalletServiceImpl) GetOrders ¶
func (w *WalletServiceImpl) GetOrders(query *OrderQuery) (res PageResult, err error)
func (*WalletServiceImpl) GetPendingRawTxByHash ¶
func (w *WalletServiceImpl) GetPendingRawTxByHash(query TransactionQuery) (result TxNotify, err error)
func (*WalletServiceImpl) GetPendingTransactions ¶
func (w *WalletServiceImpl) GetPendingTransactions(query SingleOwner) (result []txtyp.TransactionJsonResult, err error)
func (*WalletServiceImpl) GetPortfolio ¶
func (w *WalletServiceImpl) GetPortfolio(query SingleOwner) (res []Portfolio, err error)
func (*WalletServiceImpl) GetPriceQuote ¶
func (w *WalletServiceImpl) GetPriceQuote(query PriceQuoteQuery) (result PriceQuote, err error)
func (*WalletServiceImpl) GetRingMined ¶
func (w *WalletServiceImpl) GetRingMined(query RingMinedQuery) (res dao.PageResult, err error)
func (*WalletServiceImpl) GetRingMinedDetail ¶
func (w *WalletServiceImpl) GetRingMinedDetail(query RingMinedQuery) (res RingMinedDetail, err error)
func (*WalletServiceImpl) GetSupportedMarket ¶
func (w *WalletServiceImpl) GetSupportedMarket() (markets []string, err error)
func (*WalletServiceImpl) GetSupportedTokens ¶
func (w *WalletServiceImpl) GetSupportedTokens() (markets []types.Token, err error)
func (*WalletServiceImpl) GetTicker ¶
func (w *WalletServiceImpl) GetTicker() (res []market.Ticker, err error)
func (*WalletServiceImpl) GetTickers ¶
func (w *WalletServiceImpl) GetTickers(mkt SingleMarket) (result map[string]market.Ticker, err error)
func (*WalletServiceImpl) GetTransactions ¶
func (w *WalletServiceImpl) GetTransactions(query TransactionQuery) (PageResult, error)
func (*WalletServiceImpl) GetTransactionsByHash ¶
func (w *WalletServiceImpl) GetTransactionsByHash(query TransactionQuery) (result []txtyp.TransactionJsonResult, err error)
func (*WalletServiceImpl) GetTrend ¶
func (w *WalletServiceImpl) GetTrend(query TrendQuery) (res []market.Trend, err error)
func (*WalletServiceImpl) NotifyTransactionSubmitted ¶
func (w *WalletServiceImpl) NotifyTransactionSubmitted(txNotify TxNotify) (result string, err error)
func (*WalletServiceImpl) SubmitOrder ¶
func (w *WalletServiceImpl) SubmitOrder(order *types.OrderJsonRequest) (res string, err error)
func (*WalletServiceImpl) SubmitRingForP2P ¶
func (w *WalletServiceImpl) SubmitRingForP2P(p2pRing P2PRingRequest) (res string, err error)
func (*WalletServiceImpl) TestPing ¶
func (w *WalletServiceImpl) TestPing(input int) (resp []byte, err error)
func (*WalletServiceImpl) UnlockWallet ¶
func (w *WalletServiceImpl) UnlockWallet(owner SingleOwner) (result string, err error)
type WebsocketRequest ¶
type WebsocketService ¶
type WebsocketService interface { Start(port string) Stop() }
type WebsocketServiceImpl ¶
type WebsocketServiceImpl struct {
// contains filtered or unexported fields
}
func NewWebsocketService ¶
func NewWebsocketService(port string, trendManager market.TrendManager, accountManager market.AccountManager, capProvider marketcap.MarketCapProvider) *WebsocketServiceImpl
func (*WebsocketServiceImpl) Start ¶
func (ws *WebsocketServiceImpl) Start()
Source Files ¶
Click to show internal directories.
Click to hide internal directories.