bitx-bitcoin-0.6.0.0: A Haskell library for working with the BitX bitcoin exchange.

Copyright2015 Tebello Thejane
LicenseBSD3
MaintainerTebello Thejane <zyxoas+hackage@gmail.com>
StabilityExperimental
Portabilitynon-portable (GHC Extensions)
Safe HaskellNone
LanguageHaskell2010

Network.Bitcoin.BitX.Types

Description

The types used for the various BitX API calls.

Synopsis

Documentation

data Ticker Source

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.

data CcyPair Source

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

data Orderbook Source

The current state of the publically accessible orderbook. Bid orders are requests to buy, ask orders are requests to sell.

type Bid = Order Source

Convenient type alias for a bid order

type Ask = Order Source

Convenient type alias for an ask order

data BitXAuth Source

An auth type used by all private API calls, after authorisation.

Constructors

BitXAuth 

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 PENDING state even as it is partially filled, and will move to COMPLETE once it has been completely filled.

COMPLETE

Completed.

CANCELLED

Cancelled. Note that an order cannot be in CANCELLED state, since cancelling an order removes it from the orderbook.

data BitXError 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...

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.

data Asset Source

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

data WithdrawalType Source

The type of a withdrawal request.

Constructors

ZAR_EFT

ZAR by Electronic Funds Transfer

NAD_EFT

Namibian Dollar by EFT

KES_MPESA

Kenyan Shilling by Vodafone MPESA

MYR_IBG

Malaysian Ringgit by Interbank GIRO (?)

IDR_LLG

Indonesian Rupiah by Lalu Lintas Giro (??)

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 "" ""

mkAccount :: Account Source

mkAccount = Account "" "" ZAR

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 HasError s a | s -> a where Source

Methods

error :: Lens' s a Source

class HasErrorCode s a | s -> a where Source

Methods

errorCode :: Lens' s a Source

class HasBid s a | s -> a where Source

Methods

bid :: Lens' s a Source

Instances

class HasAsk s a | s -> a where Source

Methods

ask :: Lens' s a Source

Instances

class HasLastTrade s a | s -> a where Source

Methods

lastTrade :: Lens' s a Source

class HasBids s a | s -> a where Source

Methods

bids :: Lens' s a Source

class HasAsks s a | s -> a where Source

Methods

asks :: Lens' s a Source

class HasSecret s a | s -> a where Source

Methods

secret :: Lens' s a Source

class HasTrades s a | s -> a where Source

Methods

trades :: Lens' s a Source

class HasRowIndex s a | s -> a where Source

Methods

rowIndex :: Lens' s a Source

class HasAvailable s a | s -> a where Source

Methods

available :: Lens' s a Source

class HasAsset s a | s -> a where Source

Methods

asset :: Lens' s a Source

class HasReserved s a | s -> a where Source

Methods

reserved :: Lens' s a Source

class HasUnconfirmed s a | s -> a where Source

Methods

unconfirmed :: Lens' s a Source

class HasMessage s a | s -> a where Source

Methods

message :: Lens' s a Source

class HasCreatedAt s a | s -> a where Source

Methods

createdAt :: Lens' s a Source

class HasExpiresAt s a | s -> a where Source

Methods

expiresAt :: Lens' s a Source

class HasDiscarded s a | s -> a where Source

Methods

discarded :: Lens' s a Source

class HasExercised s a | s -> a where Source

Methods

exercised :: Lens' s a Source

class HasName s a | s -> a where Source

Methods

name :: Lens' s a Source