| 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 :: Scientific
- 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 {}
- 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
- data PrivateTrade = PrivateTrade {
- privateTradeBase :: Scientific
- privateTradeCounter :: Scientific
- privateTradeFeeBase :: Scientific
- privateTradeFeeCounter :: Scientific
- privateTradeIsBuy :: Bool
- privateTradeOrderId :: Text
- privateTradePair :: CcyPair
- privateTradePrice :: Scientific
- privateTradeTimestamp :: UTCTime
- privateTradeOrderType :: OrderType
- privateTradeVolume :: Scientific
- data FeeInfo = FeeInfo {}
- 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 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
- class HasBeneficiaryId s a | s -> a where
- class HasOrderId s a | s -> a where
- class HasMakerFee s a | s -> a where
- class HasTakerFee s a | s -> a where
- class HasThirtyDayVolume 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
| Eq Ticker # | |
| Data Ticker # | |
| Ord Ticker # | |
| Show Ticker # | |
| Generic Ticker # | |
| NFData Ticker # | |
| BitXAesRecordConvert Ticker # | |
| HasTimestamp Ticker UTCTime # | |
| HasRolling24HourVolume Ticker Scientific # | |
| HasPair Ticker CcyPair # | |
| HasLastTrade Ticker (Maybe Scientific) # | |
| HasBid Ticker (Maybe Scientific) # | |
| HasAsk Ticker (Maybe Scientific) # | |
| BitXAesRecordConvert [Ticker] # | |
| type Rep Ticker # | |
| type Aes Ticker # | |
| type Aes [Ticker] # | |
A currency pair
Constructors
| XBTZAR | Bitcoin vs. ZAR |
| XBTMYR | Bitcoin vs. Malaysian Ringgit |
| XBTNGN | Bitcoin vs. Nigerian Naira |
| XBTIDR | Bitcoin vs. Indonesian Rupiah |
| ETHXBT | Ether 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
| Eq Trade # | |
| Data Trade # | |
| Ord Trade # | |
| Show Trade # | |
| Generic Trade # | |
| NFData Trade # | |
| BitXAesRecordConvert Trade # | |
| HasTimestamp Trade UTCTime # | |
| HasVolume Trade Scientific # | |
| HasPrice Trade Scientific # | |
| HasIsBuy Trade Bool # | |
| BitXAesRecordConvert [Trade] # | |
| type Rep Trade # | |
| type Aes Trade # | |
| type Aes [Trade] # | |
An auth type used by all private API calls, after authorisation.
Constructors
| BitXAuth | |
Fields
| |
data PrivateOrder #
>>>:set -XOverloadedStrings>>>"id:secret" :: BitXAuthBitXAuth {bitXAuthId = "id", bitXAuthSecret = "secret"}>>>"id:se:cret" :: BitXAuthBitXAuth {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 #
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 OrderRequest #
A request to place an order.
Constructors
| OrderRequest | |
Instances
data MarketOrderRequest #
Constructors
| MarketOrderRequest | |
Instances
type RequestSuccess = Bool #
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 | |
A trade-able asset. Essentially, a currency.
Constructors
| ZAR | South African Rand |
| XBT | Bitcoin |
| MYR | Malaysian Ringgit |
| IDR | Indonesian Rupiah |
| BCH | Bitcoin Cash |
| ETH | Ether |
Instances
The current balance of a private account.
Constructors
| Balance | |
Fields | |
Instances
data FundingAddress #
A registered address for an acocunt.
Constructors
| FundingAddress | |
Instances
data WithdrawalRequest #
The state of a request to withdraw from an account.
Constructors
| WithdrawalRequest | |
Fields | |
Instances
data NewWithdrawal #
A request to withdraw from an account.
Constructors
| NewWithdrawal | |
Instances
data WithdrawalType #
The type of a withdrawal request.
data BitcoinSendRequest #
A request to send bitcoin to a bitcoin address or email address.
Constructors
| BitcoinSendRequest | |
Instances
data OrderQuote #
A temporarily locked-in quote.
Constructors
| OrderQuote | |
Instances
type BitXClientAuth = BitXAuth #
data Transaction #
A transaction on a private user account.
Constructors
| Transaction | |
Instances
A registered account.
Constructors
| Account | |
Fields
| |
data PrivateTrade #
A private trade, containing a lot more information than is avaiable when inspecting trades via the public API.
Constructors
Instances
Fee information
Constructors
| FeeInfo | |
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 #
mkBitXAuth = BitXAuth "" ""
mkBitcoinSendRequest :: BitcoinSendRequest #
mkBitcoinSendRequest = BitcoinSendRequest 0 ZAR "" Nothing Nothing
mkOrderRequest :: OrderRequest #
mkOrderRequest = OrderRequest XBTZAR BID 0 0
mkQuoteRequest :: QuoteRequest #
mkQuoteRequest = QuoteRequest BUY XBTZAR 0
mkNewWithdrawal :: NewWithdrawal #
mkNewWithdrawal = NewWithdrawal ZAR_EFT 0
mkMarketOrderRequest :: MarketOrderRequest #
mkMarketOrderRequest = MarketOrderRequest XBTZAR 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 #
Minimal complete definition
class HasRolling24HourVolume s a | s -> a where #
Minimal complete definition
Methods
rolling24HourVolume :: Lens' s a #
Instances
class HasCreationTimestamp s a | s -> a where #
Minimal complete definition
Methods
creationTimestamp :: Lens' s a #
Instances
class HasExpirationTimestamp s a | s -> a where #
Minimal complete definition
Methods
expirationTimestamp :: Lens' s a #
Instances
class HasCompletedTimestamp s a | s -> a where #
Minimal complete definition
Methods
completedTimestamp :: Lens' s a #
Instances
class HasLimitPrice s a | s -> a where #
Minimal complete definition
Methods
limitPrice :: Lens' s a #
Instances
class HasOrderType s a | s -> a where #
Minimal complete definition
class HasLimitVolume s a | s -> a where #
Minimal complete definition
Methods
limitVolume :: Lens' s a #
Instances
class HasBalanceDelta s a | s -> a where #
Minimal complete definition
Methods
balanceDelta :: Lens' s a #
Instances
class HasAvailableDelta s a | s -> a where #
Minimal complete definition
Methods
availableDelta :: Lens' s a #
Instances
class HasCurrency s a | s -> a where #
Minimal complete definition
class HasDescription s a | s -> a where #
Minimal complete definition
Methods
description :: Lens' s a #
Instances
class HasUnconfirmed s a | s -> a where #
Minimal complete definition
Methods
unconfirmed :: Lens' s a #
Instances
class HasTotalReceived s a | s -> a where #
Minimal complete definition
Methods
totalReceived :: Lens' s a #
Instances
class HasTotalUnconfirmed s a | s -> a where #
Minimal complete definition
Methods
totalUnconfirmed :: Lens' s a #
Instances
class HasWithdrawalType s a | s -> a where #
Minimal complete definition
Methods
withdrawalType :: Lens' s a #
Instances
class HasCounterAmount s a | s -> a where #
Minimal complete definition
Methods
counterAmount :: Lens' s a #
Instances
class HasBeneficiaryId s a | s -> a where #
Minimal complete definition
Methods
beneficiaryId :: Lens' s a #
Instances
class HasThirtyDayVolume s a | s -> a where #
Minimal complete definition
Methods
thirtyDayVolume :: Lens' s a #
Instances