Copyright | 2016 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
- privateOrderCompletedTimestamp :: 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
- privateOrderWithTradesCompletedTimestamp :: 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
- 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
- class HasExpirationTimestamp s a | s -> a where
- class HasCompletedTimestamp s a | s -> a where
- class HasFeeBase s a | s -> a where
- class HasFeeCounter s a | s -> a where
- class HasLimitPrice s a | s -> a where
- class HasState s a | s -> a where
- class HasOrderType s a | s -> a where
- class HasLimitVolume s a | s -> a where
- 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
- class HasAvailableDelta s a | s -> a where
- class HasCurrency s a | s -> a where
- class HasDescription s a | s -> a where
- class HasAsset s a | s -> a where
- class HasReserved s a | s -> a where
- class HasUnconfirmed s a | s -> a where
- class HasAddress s a | s -> a where
- class HasTotalReceived s a | s -> a where
- class HasTotalUnconfirmed s a | s -> a where
- class HasAmount s a | s -> a where
- class HasWithdrawalType s a | s -> a where
- class HasMessage s a | s -> a where
- class HasQuoteType s a | s -> a where
- class HasBaseAmount s a | s -> a where
- class HasCounterAmount s a | s -> a where
- 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
- class HasIsBuy s a | s -> a where
- class HasStatus 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 |
XBTIDR | Bitcoin vs. Indonesian Rupiah |
IDRXBT | Indonesian Rupiah vs. Bitcoin |
XBTSGD | Bitcoin vs. Singapore Dollar |
SGDXBT | Singapore Dollar 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 #
>>>
:set -XOverloadedStrings
>>>
"id:secret" :: BitXAuth
BitXAuth {bitXAuthId = "id", bitXAuthSecret = "secret"}>>>
"id:se:cret" :: BitXAuth
BitXAuth {bitXAuthId = "id", bitXAuthSecret = "se:cret"}
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 |
IDR | Indonesian Rupiah |
SGD | Singapore Dollar |
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 |
Instances
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 Source #
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 HasTimestamp s a | s -> a where Source #
Minimal complete definition
class HasLastTrade s a | s -> a where Source #
Minimal complete definition
class HasRolling24HourVolume s a | s -> a where Source #
Minimal complete definition
Methods
rolling24HourVolume :: Lens' s a Source #
Instances
class HasCounter s a | s -> a where Source #
Minimal complete definition
class HasCreationTimestamp s a | s -> a where Source #
Minimal complete definition
Methods
creationTimestamp :: Lens' s a Source #
class HasExpirationTimestamp s a | s -> a where Source #
Minimal complete definition
Methods
expirationTimestamp :: Lens' s a Source #
class HasCompletedTimestamp s a | s -> a where Source #
Minimal complete definition
Methods
completedTimestamp :: Lens' s a Source #
class HasFeeBase s a | s -> a where Source #
Minimal complete definition
class HasFeeCounter s a | s -> a where Source #
Minimal complete definition
Methods
feeCounter :: Lens' s a Source #
class HasLimitPrice s a | s -> a where Source #
Minimal complete definition
Methods
limitPrice :: Lens' s a Source #
class HasOrderType s a | s -> a where Source #
Minimal complete definition
class HasLimitVolume s a | s -> a where Source #
Minimal complete definition
Methods
limitVolume :: Lens' s a Source #
class HasBalanceDelta s a | s -> a where Source #
Minimal complete definition
Methods
balanceDelta :: Lens' s a Source #
Instances
class HasAvailableDelta s a | s -> a where Source #
Minimal complete definition
Methods
availableDelta :: Lens' s a Source #
Instances
class HasCurrency s a | s -> a where Source #
Minimal complete definition
class HasDescription s a | s -> a where Source #
Minimal complete definition
Methods
description :: Lens' s a Source #
Instances
class HasUnconfirmed s a | s -> a where Source #
Minimal complete definition
Methods
unconfirmed :: Lens' s a Source #
Instances
class HasTotalReceived s a | s -> a where Source #
Minimal complete definition
Methods
totalReceived :: Lens' s a Source #
Instances
class HasTotalUnconfirmed s a | s -> a where Source #
Minimal complete definition
Methods
totalUnconfirmed :: Lens' s a Source #
Instances
class HasWithdrawalType s a | s -> a where Source #
Minimal complete definition
Methods
withdrawalType :: Lens' s a Source #
Instances
class HasQuoteType s a | s -> a where Source #
Minimal complete definition
class HasBaseAmount s a | s -> a where Source #
Minimal complete definition
Methods
baseAmount :: Lens' s a Source #
class HasCounterAmount s a | s -> a where Source #
Minimal complete definition
Methods
counterAmount :: Lens' s a Source #
Instances