Documentation ¶
Index ¶
- type CancelOrderOpts
- type DepositEthOpts
- type GetOrderBookOpts
- type GetTokenBalanceOpts
- type GetTokenPriceOpts
- type GetTokenTickerOpts
- type MakeOrderOpts
- type MakeTradeOpts
- type Options
- type Order
- type OrderBook
- type OrderPost
- type PostOrderOpts
- type Service
- func (s *Service) CancelOrder(opts *CancelOrderOpts) ([]byte, error)
- func (s *Service) DepositEth(opts *DepositEthOpts) ([]byte, error)
- func (s *Service) GetJSON(url string) (string, error)
- func (s *Service) GetOrderBook(opts *GetOrderBookOpts) (*OrderBook, error)
- func (s *Service) GetTokenBalance(opts *GetTokenBalanceOpts) (*big.Int, error)
- func (s *Service) GetTokenPrice(opts *GetTokenPriceOpts) (*decimal.Decimal, error)
- func (s *Service) GetTokenTicker(opts *GetTokenTickerOpts) (*TokenTicker, error)
- func (s *Service) MakeOrder(opts *MakeOrderOpts) (string, error)
- func (s *Service) MakeTrade(opts *MakeTradeOpts) ([]byte, error)
- func (s *Service) ParseStringExpNotation(str string) string
- func (s *Service) PostOrder(opts *PostOrderOpts) (string, error)
- func (s *Service) WithdrawToken(opts *WithdrawTokenOpts) ([]byte, error)
- type TokenTicker
- type WithdrawTokenOpts
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CancelOrderOpts ¶
CancelOrderOpts Options for cancelling an order
type DepositEthOpts ¶
type DepositEthOpts struct {
Auth *bind.TransactOpts
}
DepositEthOpts Options for depositing ETH
type GetOrderBookOpts ¶
GetOrderBookOpts Options for getting order book
type GetTokenBalanceOpts ¶
GetTokenBalanceOpts Options for getting token balance
type GetTokenPriceOpts ¶
type GetTokenPriceOpts struct {
TokenSymbol string
}
GetTokenPriceOpts Options for getting token price
type GetTokenTickerOpts ¶
type GetTokenTickerOpts struct {
TokenSymbol string
}
GetTokenTickerOpts Options for getting token ticker
type MakeOrderOpts ¶
type MakeOrderOpts struct { PrivateKey string TokenAddress string UserAddress string Amount *decimal.Decimal EthCost *decimal.Decimal }
MakeOrderOpts Options for making an order
type MakeTradeOpts ¶
type MakeTradeOpts struct { Auth *bind.TransactOpts Order *OrderPost EthCost *big.Int }
MakeTrade Options for making a trade
type Options ¶
type Options struct { ProviderURI string // contains filtered or unexported fields }
Options service options
type Order ¶
type Order struct { Id string `json:"id"` Amount string `json:"amount"` Price string `json:"price"` TokenGet string `json:"tokenGet"` AmountGet string `json:"amountGet"` TokenGive string `json:"tokenGive"` AmountGive string `json:"amountGive"` Expires string `json:"expires"` Nonce string `json:"nonce"` V int `json:"v"` R string `json:"r"` S string `json:"s"` User string `json:"user"` Updated string `json:"updated"` AvailableVolume string `json:"availableVolume"` EthAvailableVolume string `json:"ethAvailableVolume"` AvailableVolumeBase string `json:"availableVolumeBase"` AmountFilled string `json:"amountFilled"` }
Order Individual order struct
type OrderPost ¶
type OrderPost struct { AmountGet string `json:"amountGet"` AmountGive string `json:"amountGive"` TokenGet string `json:"tokenGet"` TokenGive string `json:"tokenGive"` ContractAddress string `json:"contractAddr"` Expires int `json:"expires"` Nonce int `json:"nonce"` User string `json:"user"` V int `json:"v"` R string `json:"r"` S string `json:"s"` }
OrderPost Order struct for posting a new order to EtherDelta
type PostOrderOpts ¶
PostOrderOpts Options for posting an order
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service service struct
func NewForkDelta ¶
NewForkDelta returns new ForkDelta service
func (*Service) CancelOrder ¶
func (s *Service) CancelOrder(opts *CancelOrderOpts) ([]byte, error)
CancelOrder Cancel an order on EtherDelta
func (*Service) DepositEth ¶
func (s *Service) DepositEth(opts *DepositEthOpts) ([]byte, error)
DepositEth Deposit ETH to EtherDelta
func (*Service) GetOrderBook ¶
func (s *Service) GetOrderBook(opts *GetOrderBookOpts) (*OrderBook, error)
GetOrderBook Get the Order Book
func (*Service) GetTokenBalance ¶
func (s *Service) GetTokenBalance(opts *GetTokenBalanceOpts) (*big.Int, error)
GetTokenBalance Get token balance on EtherDelta for account
func (*Service) GetTokenPrice ¶
func (s *Service) GetTokenPrice(opts *GetTokenPriceOpts) (*decimal.Decimal, error)
GetTokenPrice Get last trade price for token
func (*Service) GetTokenTicker ¶
func (s *Service) GetTokenTicker(opts *GetTokenTickerOpts) (*TokenTicker, error)
GetTokenTicker Get ticker info for token
func (*Service) MakeOrder ¶
func (s *Service) MakeOrder(opts *MakeOrderOpts) (string, error)
MakeOrder Generate an order and post it to EtherDelta
func (*Service) MakeTrade ¶
func (s *Service) MakeTrade(opts *MakeTradeOpts) ([]byte, error)
MakeTrade Make an order trade on EtherDelta
func (*Service) ParseStringExpNotation ¶
ParseStringExpNotation Parse string in exponential notation
func (*Service) PostOrder ¶
func (s *Service) PostOrder(opts *PostOrderOpts) (string, error)
PostOrder Post an order to EtherDelta
func (*Service) WithdrawToken ¶
func (s *Service) WithdrawToken(opts *WithdrawTokenOpts) ([]byte, error)
WithdrawToken Withdraw token from EtherDelta
type TokenTicker ¶
type TokenTicker struct { Ask *decimal.Decimal `json:"ask"` BaseVolume *decimal.Decimal `json:"baseVolume"` Bid *decimal.Decimal `json:"bid"` Last *decimal.Decimal `json:"last"` PercentChange *decimal.Decimal `json:"percentChange"` QuoteVolume *decimal.Decimal `json:"quoteVolume"` TokenAddress string `json:"tokenAddr"` }
TokenTicker Ticker infor for token
type WithdrawTokenOpts ¶
type WithdrawTokenOpts struct { Auth *bind.TransactOpts TokenAddress string TokenAmount *big.Int }
WithdrawTokenOpts Options for withdrawing token