Documentation ¶
Index ¶
- Constants
- type Binacancel
- type Binadeposit
- type Binadepositaddress
- type Binadeposits
- type Binainfo
- type Binance
- func (self *Binance) Address(token common.Token) (ethereum.Address, bool)
- func (self *Binance) CancelOrder(id common.ActivityID) error
- func (self *Binance) DepositStatus(id common.ActivityID, timepoint uint64) (string, error)
- func (self *Binance) FetchEBalanceData(timepoint uint64) (common.EBalanceEntry, error)
- func (self *Binance) FetchOrderData(timepoint uint64) (common.OrderEntry, error)
- func (self Binance) FetchPriceData(timepoint uint64) (map[common.TokenPairID]common.ExchangePrice, error)
- func (self *Binance) ID() common.ExchangeID
- func (self *Binance) MarshalText() (text []byte, err error)
- func (self *Binance) Name() string
- func (self *Binance) OrderStatus(id common.ActivityID, timepoint uint64) (string, error)
- func (self *Binance) TokenPairs() []common.TokenPair
- func (self *Binance) Trade(tradeType string, base common.Token, quote common.Token, rate float64, ...) (id string, done float64, remaining float64, finished bool, err error)
- func (self *Binance) UpdateAllDepositAddresses(address string)
- func (self *Binance) UpdateDepositAddress(token common.Token, address string)
- func (self *Binance) Withdraw(token common.Token, amount *big.Int, address ethereum.Address, ...) (string, error)
- func (self *Binance) WithdrawStatus(id common.ActivityID, timepoint uint64) (string, error)
- type BinanceInterface
- type Binaorder
- type Binaorders
- type Binaresp
- type Binatrade
- type Binawithdraw
- type Binawithdrawal
- type Binawithdrawals
- type Bitfinex
- func (self *Bitfinex) Address(token common.Token) (ethereum.Address, bool)
- func (self *Bitfinex) FetchEBalanceData(timepoint uint64) (common.EBalanceEntry, error)
- func (self *Bitfinex) FetchPriceData(timepoint uint64) (map[common.TokenPairID]common.ExchangePrice, error)
- func (self *Bitfinex) ID() common.ExchangeID
- func (self *Bitfinex) MarshalText() (text []byte, err error)
- func (self *Bitfinex) Name() string
- func (self *Bitfinex) TokenPairs() []common.TokenPair
- func (self *Bitfinex) Trade(tradeType string, base common.Token, quote common.Token, rate float64, ...) (done float64, remaining float64, finished bool, err error)
- func (self *Bitfinex) UpdateAllDepositAddresses(address string)
- func (self *Bitfinex) UpdateDepositAddress(token common.Token, address string)
- func (self *Bitfinex) Withdraw(token common.Token, amount *big.Int, address ethereum.Address, ...) error
- type BitfinexInterface
- type Bitfinfo
- type Bitfresp
- type Bitftrade
- type Bitfwithdraw
- type Bittinfo
- type Bittresp
- type Bittrex
- func (self *Bittrex) Address(token common.Token) (ethereum.Address, bool)
- func (self *Bittrex) FetchEBalanceData(timepoint uint64) (common.EBalanceEntry, error)
- func (self *Bittrex) FetchPriceData(timepoint uint64) (map[common.TokenPairID]common.ExchangePrice, error)
- func (self *Bittrex) ID() common.ExchangeID
- func (self *Bittrex) MarshalText() (text []byte, err error)
- func (self *Bittrex) Name() string
- func (self *Bittrex) TokenPairs() []common.TokenPair
- func (self *Bittrex) Trade(tradeType string, base common.Token, quote common.Token, rate float64, ...) (done float64, remaining float64, finished bool, err error)
- func (self *Bittrex) UpdateAllDepositAddresses(address string)
- func (self *Bittrex) UpdateDepositAddress(token common.Token, address string)
- func (self *Bittrex) Withdraw(token common.Token, amount *big.Int, address ethereum.Address, ...) error
- type BittrexInterface
- type Bitttrade
- type Bitttraderesult
- type Bittwithdraw
- type Liqcancel
- type Liqinfo
- type Liqorderinfo
- type Liqorders
- type Liqresp
- type Liqtrade
- type Liqui
- func (self *Liqui) Address(token common.Token) (ethereum.Address, bool)
- func (self *Liqui) CancelOrder(id common.ActivityID) error
- func (self *Liqui) DepositStatus(id common.ActivityID, timepoint uint64) (string, error)
- func (self *Liqui) FetchEBalanceData(timepoint uint64) (common.EBalanceEntry, error)
- func (self *Liqui) FetchOrderData(timepoint uint64) (common.OrderEntry, error)
- func (self *Liqui) FetchPriceData(timepoint uint64) (map[common.TokenPairID]common.ExchangePrice, error)
- func (self *Liqui) ID() common.ExchangeID
- func (self *Liqui) MarshalText() (text []byte, err error)
- func (self *Liqui) Name() string
- func (self *Liqui) OrderStatus(id common.ActivityID, timepoint uint64) (string, error)
- func (self *Liqui) TokenPairs() []common.TokenPair
- func (self *Liqui) Trade(tradeType string, base common.Token, quote common.Token, rate float64, ...) (id string, done float64, remaining float64, finished bool, err error)
- func (self *Liqui) UpdateAllDepositAddresses(address string)
- func (self *Liqui) UpdateDepositAddress(token common.Token, address string)
- func (self *Liqui) Withdraw(token common.Token, amount *big.Int, address ethereum.Address, ...) (string, error)
- func (self *Liqui) WithdrawStatus(id common.ActivityID, timepoint uint64) (string, error)
- type LiquiInterface
- type Liqwithdraw
Constants ¶
View Source
const ( DEPOSIT_WAITING_TIME uint64 = 10 * 60 * 1000 WITHDRAW_WAITING_TIME uint64 = 5 * 60 * 1000 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Binacancel ¶
type Binadeposit ¶
type Binadepositaddress ¶
type Binadeposits ¶
type Binadeposits struct { Success bool `json:"success"` Msg string `json:"msg"` Deposits []Binadeposit `json:"depositList"` }
{ "depositList": [ { "insertTime": 1508198532000, "amount": 0.04670582, "asset": "ETH", "address": "0x6915f16f8791d0a1cc2bf47c13a6b2a92000504b", "txId": "0xdf33b22bdb2b28b1f75ccd201a4a4m6e7g83jy5fc5d5a9d1340961598cfcb0a1", "status": 1 }, { "insertTime": 1508298532000, "amount": 1000, "asset": "XMR", "address": "463tWEBn5XZJSxLU34r6g7h8jtxuNcDbjLSjkn3XAXHCbLrTTErJrBWYgHJQyrCwkNgYvyV3z8zctJLPCZy24jvb3NiTcTJ", "addressTag": "342341222", "txId": "b3c6219639c8ae3f9cf010cdc24fw7f7yt8j1e063f9b4bd1a05cb44c4b6e2509", "status": 1 } ], "success": true }
type Binainfo ¶
type Binainfo struct { Code int `json:"code"` Msg string `json:"msg"` MakerCommission int64 `json:"makerCommission"` TakerCommission int64 `json:"takerCommission"` BuyerCommission int64 `json:"buyerCommission"` SellerCommission int64 `json:"sellerCommission"` CanTrade bool `json:"canTrade"` CanWithdraw bool `json:"canWithdraw"` CanDeposit bool `json:"canDeposit"` Balances []struct { Asset string `json:"asset"` Free string `json:"free"` Locked string `json:"locked` } `json:"balances` }
type Binance ¶
type Binance struct {
// contains filtered or unexported fields
}
func NewBinance ¶
func NewBinance(interf BinanceInterface) *Binance
func (*Binance) CancelOrder ¶
func (self *Binance) CancelOrder(id common.ActivityID) error
func (*Binance) DepositStatus ¶
func (*Binance) FetchEBalanceData ¶
func (self *Binance) FetchEBalanceData(timepoint uint64) (common.EBalanceEntry, error)
func (*Binance) FetchOrderData ¶
func (self *Binance) FetchOrderData(timepoint uint64) (common.OrderEntry, error)
func (Binance) FetchPriceData ¶
func (self Binance) FetchPriceData(timepoint uint64) (map[common.TokenPairID]common.ExchangePrice, error)
func (*Binance) ID ¶
func (self *Binance) ID() common.ExchangeID
func (*Binance) MarshalText ¶
func (*Binance) OrderStatus ¶
func (*Binance) TokenPairs ¶
func (*Binance) UpdateAllDepositAddresses ¶
func (*Binance) UpdateDepositAddress ¶
func (*Binance) WithdrawStatus ¶
type BinanceInterface ¶
type BinanceInterface interface { FetchOnePairData( wg *sync.WaitGroup, pair common.TokenPair, data *sync.Map, timepoint uint64) OpenOrdersForOnePair( wg *sync.WaitGroup, pair common.TokenPair, data *sync.Map, timepoint uint64) GetInfo(timepoint uint64) (Binainfo, error) Withdraw( token common.Token, amount *big.Int, address ethereum.Address, timepoint uint64) (string, error) Trade( tradeType string, base, quote common.Token, rate, amount float64, timepoint uint64) (id string, done float64, remaining float64, finished bool, err error) CancelOrder(symbol string, id uint64) (Binacancel, error) DepositHistory(startTime, endTime uint64) (Binadeposits, error) WithdrawHistory(startTime, endTime uint64) (Binawithdrawals, error) OrderStatus(symbol string, id uint64, timepoint uint64) (Binaorder, error) }
type Binaorder ¶
type Binaorder struct { Code int `json:"code"` Message string `json:"msg"` Symbol string `json:"symbol"` OrderId uint64 `json:"orderId"` ClientOrderId string `json:"clientOrderId"` Price string `json:"price"` OrigQty string `json:"origQty"` ExecutedQty string `json:"executedQty"` Status string `json:"status"` TimeInForce string `json:"timeInForce"` Type string `json:"type"` Side string `json:"side"` StopPrice string `json:"stopPrice"` IcebergQty string `json:"icebergQty"` Time uint64 `json:"time"` }
type Binaorders ¶
type Binaorders []Binaorder
type Binawithdraw ¶
type Binawithdrawal ¶
type Binawithdrawals ¶
type Binawithdrawals struct { Success bool `json:"success"` Msg string `json:"msg"` Withdrawals []Binawithdrawal `json:"withdrawList"` }
{ "withdrawList": [ { "id":"7213fea8e94b4a5593d507237e5a555b" "amount": 1, "address": "0x6915f16f8791d0a1cc2bf47c13a6b2a92000504b", "asset": "ETH", "txId": "0xdf33b22bdb2b28b1f75ccd201a4a4m6e7g83jy5fc5d5a9d1340961598cfcb0a1", "applyTime": 1508198532000 "status": 4 }, { "id":"7213fea8e94b4a5534ggsd237e5a555b" "amount": 1000, "address": "463tWEBn5XZJSxLU34r6g7h8jtxuNcDbjLSjkn3XAXHCbLrTTErJrBWYgHJQyrCwkNgYvyV3z8zctJLPCZy24jvb3NiTcTJ", "addressTag": "342341222", "txId": "b3c6219639c8ae3f9cf010cdc24fw7f7yt8j1e063f9b4bd1a05cb44c4b6e2509", "asset": "XMR", "applyTime": 1508198532000, "status": 4 } ], "success": true }
type Bitfinex ¶
type Bitfinex struct {
// contains filtered or unexported fields
}
func NewBitfinex ¶
func NewBitfinex(interf BitfinexInterface) *Bitfinex
func (*Bitfinex) FetchEBalanceData ¶
func (self *Bitfinex) FetchEBalanceData(timepoint uint64) (common.EBalanceEntry, error)
func (*Bitfinex) FetchPriceData ¶
func (self *Bitfinex) FetchPriceData(timepoint uint64) (map[common.TokenPairID]common.ExchangePrice, error)
func (*Bitfinex) ID ¶
func (self *Bitfinex) ID() common.ExchangeID
func (*Bitfinex) MarshalText ¶
func (*Bitfinex) TokenPairs ¶
func (*Bitfinex) UpdateAllDepositAddresses ¶
func (*Bitfinex) UpdateDepositAddress ¶
type BitfinexInterface ¶
type BitfinexInterface interface { GetInfo(timepoint uint64) (Bitfinfo, error) FetchOnePairData( wg *sync.WaitGroup, pair common.TokenPair, data *sync.Map, timepoint uint64) Withdraw( token common.Token, amount *big.Int, address ethereum.Address, timepoint uint64) error Trade( tradeType string, base, quote common.Token, rate, amount float64, timepoint uint64) (done float64, remaining float64, finished bool, err error) }
type Bitfwithdraw ¶
type Bittinfo ¶
type Bittinfo struct { Success int `json:"success"` Result struct { Currency string `json:"Currency"` Balance float64 `json:"Balance"` Available float64 `json:"Available"` Pending float64 `json:"Pending"` CryptoAddress string `json:"CryptoAddress"` Requested bool `json:"Requested"` Uuid string `json:"uuid"` } Error string `json:"error"` }
type Bittresp ¶
type Bittresp struct { Success bool `json:"success"` Msg string `json:"message"` Result map[string][]map[string]float64 `json:"result"` }
map of token pair to map of asks/bids to array of [rate, amount]
type Bittrex ¶
type Bittrex struct {
// contains filtered or unexported fields
}
func NewBittrex ¶
func NewBittrex(interf BittrexInterface) *Bittrex
func (*Bittrex) FetchEBalanceData ¶
func (self *Bittrex) FetchEBalanceData(timepoint uint64) (common.EBalanceEntry, error)
func (*Bittrex) FetchPriceData ¶
func (self *Bittrex) FetchPriceData(timepoint uint64) (map[common.TokenPairID]common.ExchangePrice, error)
func (*Bittrex) ID ¶
func (self *Bittrex) ID() common.ExchangeID
func (*Bittrex) MarshalText ¶
func (*Bittrex) TokenPairs ¶
func (*Bittrex) UpdateAllDepositAddresses ¶
func (*Bittrex) UpdateDepositAddress ¶
type BittrexInterface ¶
type BittrexInterface interface { FetchOnePairData(wq *sync.WaitGroup, pair common.TokenPair, data *sync.Map, timepoint uint64) GetInfo(timepoint uint64) (Bittinfo, error) Withdraw( token common.Token, amount *big.Int, address ethereum.Address, timepoint uint64) error Trade( tradeType string, base, quote common.Token, rate, amount float64, timepoint uint64) (done float64, remaining float64, finished bool, err error) }
type Bitttrade ¶
type Bitttrade struct { Success int `json:"success"` Return Bitttraderesult `json:"result"` Error string `json:"message"` }
type Bitttraderesult ¶
type Bittwithdraw ¶
type Liqorderinfo ¶
type Liqorderinfo struct { Success int `json:"success"` Return map[string]struct { Pair string `json:"pair"` Type string `json:"type"` StartAmount float64 `json:"start_amount"` Amount float64 `json:"amount"` Rate float64 `json:"rate"` Timestamp uint64 `json:"timestamp_created"` Status int `json:"status"` } `json:"return"` Error string `json:"error"` }
type Liqui ¶
type Liqui struct {
// contains filtered or unexported fields
}
func NewLiqui ¶
func NewLiqui(interf LiquiInterface) *Liqui
func (*Liqui) CancelOrder ¶
func (self *Liqui) CancelOrder(id common.ActivityID) error
func (*Liqui) DepositStatus ¶
func (*Liqui) FetchEBalanceData ¶
func (self *Liqui) FetchEBalanceData(timepoint uint64) (common.EBalanceEntry, error)
func (*Liqui) FetchOrderData ¶
func (self *Liqui) FetchOrderData(timepoint uint64) (common.OrderEntry, error)
func (*Liqui) FetchPriceData ¶
func (self *Liqui) FetchPriceData(timepoint uint64) (map[common.TokenPairID]common.ExchangePrice, error)
func (*Liqui) ID ¶
func (self *Liqui) ID() common.ExchangeID
func (*Liqui) MarshalText ¶
func (*Liqui) OrderStatus ¶
func (*Liqui) TokenPairs ¶
func (*Liqui) UpdateAllDepositAddresses ¶
func (*Liqui) UpdateDepositAddress ¶
func (*Liqui) WithdrawStatus ¶
type LiquiInterface ¶
type LiquiInterface interface { Depth(tokens string, timepoint uint64) (Liqresp, error) GetInfo(timepoint uint64) (Liqinfo, error) ActiveOrders(timepoint uint64) (Liqorders, error) OrderInfo(orderID string, timepoint uint64) (Liqorderinfo, error) Withdraw( token common.Token, amount *big.Int, address ethereum.Address, timepoint uint64) error Trade( tradeType string, base, quote common.Token, rate, amount float64, timepoint uint64) (id string, done float64, remaining float64, finished bool, err error) CancelOrder(id string) (Liqcancel, error) }
type Liqwithdraw ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.