bitcoin-payment-channel-0.1.1.3: Library for working with Bitcoin payment channels

Copyright(c) Rune K. Svendsen, 2016
LicensePublicDomain
Maintainerrunesvend@gmail.com
Safe HaskellNone
LanguageHaskell2010

Data.Bitcoin.PaymentChannel.Types

Description

Types used with the interface provided by Data.Bitcoin.PaymentChannel.

Synopsis

Documentation

class PaymentChannel a where Source #

Get various information about an open payment channel.

Minimal complete definition

valueToMe, getChannelState

Methods

valueToMe :: a -> BitcoinAmount Source #

Get value sent to receiver/left for sender

getChannelState :: a -> PaymentChannelState Source #

Retrieve internal state object

getChannelID :: a -> TxHash Source #

Get channel ID

_setChannelState :: a -> PaymentChannelState -> a Source #

For internal use

channelValueLeft :: a -> BitcoinAmount Source #

channelIsExhausted :: a -> Bool Source #

Returns True if all available channel value has been transferred, False otherwise

data Payment Source #

Used to transfer value from sender to receiver.

Instances

data FundingTxInfo Source #

Holds information about the Bitcoin transaction used to fund the channel

Constructors

CFundingTxInfo 

Fields

data BitcoinAmount Source #

Represents a bitcoin amount as number of satoshis. 1 satoshi = 1e-8 bitcoins. Integer operations will never over- or underflow with this type. Convert to a Word64 using toWord64, which caps the final amount.

Instances

Enum BitcoinAmount Source # 
Eq BitcoinAmount Source # 
Integral BitcoinAmount Source # 
Num BitcoinAmount Source # 
Ord BitcoinAmount Source # 
Real BitcoinAmount Source # 
Show BitcoinAmount Source # 
Binary BitcoinAmount Source # 
Serialize BitcoinAmount Source # 

toWord64 :: BitcoinAmount -> Word64 Source #

Convert to Word64, with zero as floor, UINT64_MAX as ceiling