| Copyright | 2015 Tebello Thejane |
|---|---|
| License | BSD3 |
| Maintainer | Tebello Thejane <zyxoas+hackage@gmail.com> |
| Stability | Experimental |
| Portability | non-portable (GHC Extensions) |
| Safe Haskell | None |
| Language | Haskell2010 |
Network.Bitcoin.BitX.Types
Description
The types used for the various BitX API calls.
- data Ticker = Ticker {}
- data CcyPair
- data Orderbook = Orderbook {
- orderbookTimestamp :: UTCTime
- orderbookBids :: [Bid]
- orderbookAsks :: [Ask]
- data Order = Order {}
- type Bid = Order
- type Ask = Order
- data Trade = Trade {}
- data BitXAuth = BitXAuth {
- bitXAuthId :: Text
- bitXAuthSecret :: Text
- data PrivateOrder = PrivateOrder {
- privateOrderBase :: Scientific
- privateOrderCounter :: Scientific
- privateOrderCreationTimestamp :: UTCTime
- privateOrderExpirationTimestamp :: UTCTime
- privateOrderFeeBase :: Scientific
- privateOrderFeeCounter :: Scientific
- privateOrderLimitPrice :: Int
- privateOrderLimitVolume :: Scientific
- privateOrderId :: OrderID
- privateOrderPair :: CcyPair
- privateOrderState :: RequestStatus
- privateOrderOrderType :: OrderType
- type OrderID = Text
- data OrderType
- data RequestStatus
- data OrderRequest = OrderRequest {}
- data MarketOrderRequest = MarketOrderRequest {}
- type RequestSuccess = Bool
- data BitXError = BitXError {}
- data PrivateOrderWithTrades = PrivateOrderWithTrades {
- privateOrderWithTradesBase :: Scientific
- privateOrderWithTradesCounter :: Scientific
- privateOrderWithTradesCreationTimestamp :: UTCTime
- privateOrderWithTradesExpirationTimestamp :: UTCTime
- privateOrderWithTradesFeeBase :: Scientific
- privateOrderWithTradesFeeCounter :: Scientific
- privateOrderWithTradesLimitPrice :: Int
- privateOrderWithTradesLimitVolume :: Scientific
- privateOrderWithTradesId :: OrderID
- privateOrderWithTradesPair :: CcyPair
- privateOrderWithTradesState :: RequestStatus
- privateOrderWithTradesOrderType :: OrderType
- privateOrderWithTradesTrades :: [Trade]
- type AccountID = Text
- data Asset
- data Balance = Balance {}
- data FundingAddress = FundingAddress {}
- data WithdrawalRequest = WithdrawalRequest {}
- data NewWithdrawal = NewWithdrawal {}
- data WithdrawalType
- data BitcoinSendRequest = BitcoinSendRequest {}
- data QuoteRequest = QuoteRequest {}
- data OrderQuote = OrderQuote {}
- data QuoteType
- type BitXClientAuth = BitXAuth
- data Transaction = Transaction {}
- data Account = Account {
- accountId :: Text
- accountName :: Text
- accountCurrency :: Asset
- mkBitXAuth :: BitXAuth
- mkAccount :: Account
- mkBitcoinSendRequest :: BitcoinSendRequest
- mkOrderRequest :: OrderRequest
- mkQuoteRequest :: QuoteRequest
- mkNewWithdrawal :: NewWithdrawal
- mkMarketOrderRequest :: MarketOrderRequest
- class HasError s a | s -> a where
- class HasErrorCode s a | s -> a where
- class HasTimestamp s a | s -> a where
- class HasBid s a | s -> a where
- class HasAsk s a | s -> a where
- class HasLastTrade s a | s -> a where
- class HasRolling24HourVolume s a | s -> a where
- rolling24HourVolume :: Lens' s a
- class HasPair s a | s -> a where
- class HasVolume s a | s -> a where
- class HasPrice s a | s -> a where
- class HasBids s a | s -> a where
- class HasAsks s a | s -> a where
- class HasSecret s a | s -> a where
- class HasId s a | s -> a where
- class HasBase s a | s -> a where
- class HasCounter s a | s -> a where
- class HasCreationTimestamp s a | s -> a where
- creationTimestamp :: Lens' s a
- class HasExpirationTimestamp s a | s -> a where
- expirationTimestamp :: Lens' s a
- class HasFeeBase s a | s -> a where
- class HasFeeCounter s a | s -> a where
- feeCounter :: Lens' s a
- class HasLimitPrice s a | s -> a where
- limitPrice :: Lens' s a
- class HasState s a | s -> a where
- class HasOrderType s a | s -> a where
- class HasLimitVolume s a | s -> a where
- limitVolume :: Lens' s a
- class HasTrades s a | s -> a where
- class HasRowIndex s a | s -> a where
- class HasBalance s a | s -> a where
- class HasAvailable s a | s -> a where
- class HasBalanceDelta s a | s -> a where
- balanceDelta :: Lens' s a
- class HasAvailableDelta s a | s -> a where
- availableDelta :: Lens' s a
- class HasCurrency s a | s -> a where
- class HasDescription s a | s -> a where
- description :: Lens' s a
- class HasAsset s a | s -> a where
- class HasReserved s a | s -> a where
- class HasUnconfirmed s a | s -> a where
- unconfirmed :: Lens' s a
- class HasAddress s a | s -> a where
- class HasTotalReceived s a | s -> a where
- totalReceived :: Lens' s a
- class HasTotalUnconfirmed s a | s -> a where
- totalUnconfirmed :: Lens' s a
- class HasAmount s a | s -> a where
- class HasWithdrawalType s a | s -> a where
- withdrawalType :: Lens' s a
- class HasMessage s a | s -> a where
- class HasQuoteType s a | s -> a where
- class HasBaseAmount s a | s -> a where
- baseAmount :: Lens' s a
- class HasCounterAmount s a | s -> a where
- counterAmount :: Lens' s a
- class HasCreatedAt s a | s -> a where
- class HasExpiresAt s a | s -> a where
- class HasDiscarded s a | s -> a where
- class HasExercised s a | s -> a where
- class HasName s a | s -> a where
Documentation
The state of a single market, identified by the currency pair.
As usual, the ask/sell price is the price of the last filled ask order, and the bid/buy price is
the price of the last filled bid order. Necessarily bid <= ask.
Constructors
| Ticker | |
Fields
| |
Instances
A currency pair
Constructors
| XBTZAR | Bitcoin vs. ZAR |
| XBTNAD | Bitcoin vs. Namibian Dollar |
| ZARXBT | ZAR vs. Namibian Dollar |
| NADXBT | Namibian Dollar vs. Bitcoin |
| XBTKES | Bitcoin vs. Kenyan Shilling |
| KESXBT | Kenyan Shilling vs Bitcoin |
| XBTMYR | Bitcoin vs. Malaysian Ringgit |
| MYRXBT | Malaysian Ringgit vs. Bitcoin |
| XBTNGN | Bitcoin vs. Nigerian Naira |
| NGNXBT | Nigerian Naira vs. Bitcoin |
Instances
The current state of the publically accessible orderbook. Bid orders are requests to buy, ask orders are requests to sell.
Constructors
| Orderbook | |
Fields
| |
A single placed order in the orderbook
Constructors
| Order | |
Fields
| |
Constructors
| Trade | |
Fields
| |
Instances
An auth type used by all private API calls, after authorisation.
Constructors
| BitXAuth | |
Fields
| |
data PrivateOrder Source
A recently placed (private) order, containing a lot more information than is available on the public order book.
Constructors
Instances
The type of a placed order.
Instances
data RequestStatus Source
The state of a (private) placed request -- either an order or a withdrawal request.
Constructors
| PENDING | Not yet completed. An order will stay in |
| COMPLETE | Completed. |
| CANCELLED | Cancelled. Note that an order cannot be in |
data MarketOrderRequest Source
Constructors
| MarketOrderRequest | |
type RequestSuccess = Bool Source
A possible error which the BitX API might return, instead of returning the requested data. Note that as yet there is no exhaustive list of error codes available, so comparisons will have to be done via Text comparisons (as opposed to typed pattern matching). Sorry...
Constructors
| BitXError | |
Fields | |
data PrivateOrderWithTrades Source
A recently placed (private) order, containing a lot more information than is available on the public order book, together with details of any trades which have (partially) filled it.
Constructors
Instances
A trade-able asset. Essentially, a currency.
Constructors
| ZAR | South African Rand |
| NAD | Namibian Dollar |
| XBT | Bitcoin |
| KES | Kenyan Shilling |
| MYR | Malaysian Ringgit |
| NGN | Nigerian Naira |
Instances
The current balance of a private account.
Constructors
| Balance | |
Fields | |
Instances
data FundingAddress Source
A registered address for an acocunt.
Constructors
| FundingAddress | |
Instances
data WithdrawalRequest Source
The state of a request to withdraw from an account.
Constructors
| WithdrawalRequest | |
Fields | |
data WithdrawalType Source
The type of a withdrawal request.
data BitcoinSendRequest Source
A request to send bitcoin to a bitcoin address or email address.
Constructors
| BitcoinSendRequest | |
Instances
data OrderQuote Source
A temporarily locked-in quote.
Constructors
| OrderQuote | |
Instances
type BitXClientAuth = BitXAuth Source
data Transaction Source
A transaction on a private user account.
Constructors
| Transaction | |
Instances
A registered account.
Constructors
| Account | |
Fields
| |
Convenient constructors for records which serve as input parameters to functions. These are not completely safe (since you can forget to set a field and the Haskell compiler won't notice), but they are a bit more convenient than dealing with the raw records directly, as long as you're careful.
mkBitXAuth = BitXAuth "" ""
mkBitcoinSendRequest :: BitcoinSendRequest Source
mkBitcoinSendRequest = BitcoinSendRequest 0 ZAR "" Nothing Nothing
mkOrderRequest :: OrderRequest Source
mkOrderRequest = OrderRequest ZARXBT BID 0 0
mkQuoteRequest :: QuoteRequest Source
mkQuoteRequest = QuoteRequest BUY ZARXBT 0
mkNewWithdrawal :: NewWithdrawal Source
mkNewWithdrawal = NewWithdrawal ZAR_EFT 0
mkMarketOrderRequest :: MarketOrderRequest Source
mkMarketOrderRequest = MarketOrderRequest ZARXBT BID 0
Lens Has* instances for convenient record accessors and mutators.
For a broader view of how these function (and why you can generally ignore them) see the
documentation for lens's makeFields.
Essentially, an instance declaration of the form
instance HasFoo MyRecord Int
implies that we can pretend that the data type MyRecord has a field called Foo of type Int
(although in reality the field would be called myRecordFoo or such), and that there exists a
lens called foo which can be used -- among other things -- as a setter and getter on
MyRecord.
class HasErrorCode s a | s -> a where Source
Instances
class HasTimestamp s a | s -> a where Source
class HasLastTrade s a | s -> a where Source
Instances
class HasRolling24HourVolume s a | s -> a where Source
Methods
rolling24HourVolume :: Lens' s a Source
Instances
class HasCounter s a | s -> a where Source
class HasCreationTimestamp s a | s -> a where Source
Methods
creationTimestamp :: Lens' s a Source
class HasExpirationTimestamp s a | s -> a where Source
Methods
expirationTimestamp :: Lens' s a Source
class HasFeeBase s a | s -> a where Source
class HasFeeCounter s a | s -> a where Source
Methods
feeCounter :: Lens' s a Source
class HasLimitPrice s a | s -> a where Source
Methods
limitPrice :: Lens' s a Source
class HasOrderType s a | s -> a where Source
class HasLimitVolume s a | s -> a where Source
Methods
limitVolume :: Lens' s a Source
class HasRowIndex s a | s -> a where Source
Instances
class HasBalance s a | s -> a where Source
class HasAvailable s a | s -> a where Source
Instances
class HasCurrency s a | s -> a where Source
class HasDescription s a | s -> a where Source
Methods
description :: Lens' s a Source
class HasReserved s a | s -> a where Source
Instances
class HasAddress s a | s -> a where Source
class HasTotalUnconfirmed s a | s -> a where Source
Methods
totalUnconfirmed :: Lens' s a Source
class HasWithdrawalType s a | s -> a where Source
Methods
withdrawalType :: Lens' s a Source
class HasMessage s a | s -> a where Source
Instances
class HasQuoteType s a | s -> a where Source
class HasBaseAmount s a | s -> a where Source
Methods
baseAmount :: Lens' s a Source
class HasCreatedAt s a | s -> a where Source
Instances
class HasExpiresAt s a | s -> a where Source
Instances
class HasDiscarded s a | s -> a where Source
Instances
class HasExercised s a | s -> a where Source
Instances