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

Safe HaskellNone
LanguageHaskell2010

Data.Bitcoin.PaymentChannel.Test

Contents

Synopsis

Documentation

data PaymentChannelState Source #

Shared state object used by both value sender and value receiver.

Constructors

CPaymentChannelState 

Fields

data FundingTxInfo Source #

Holds information about the Bitcoin transaction used to fund the channel

Constructors

CFundingTxInfo 

Fields

data PaymentTxConfig Source #

Holds information about how to construct the payment transaction

Constructors

CPaymentTxConfig 

Fields

data Config Source #

Miscellaneous configuration options

Constructors

Config 

Fields

  • cDustLimit :: BitcoinAmount

    Refuse to accept/produce payments with a client change value less than this amount.

  • cSettlementPeriod :: Hour

    This many hours before the channel expiration date, consider the channel closed. This gives the receiver time to publish the settlement transaction, before the refund transaction becomes valid.

Instances

data Payment Source #

Contains the bare minimum of information to transfer value from sender to receiver.

Constructors

CPayment 

Fields

Instances

data FullPayment Source #

Contains all information required to construct the payment transaction

Constructors

CFullPayment 

Fields

data PaymentSignature Source #

Contains payment signature plus sig hash flag byte

Constructors

CPaymentSignature 

Fields

newtype ChanScript Source #

Wraps a Network.Haskoin.Script.Script

Constructors

ChanScript 

Fields

type ReceiverPaymentChannel = ReceiverPaymentChannelI () Source #

ReceiverPaymentChannel without public key metadata

type ReceiverPaymentChannelX = ReceiverPaymentChannelI XPubKey Source #

ReceiverPaymentChannel with BIP32 , "extended" public key metadata

data ReceiverPaymentChannelI pkInfo Source #

State object for the value receiver. pkInfo holds optional, extra data associated with the receiver public key

Constructors

CReceiverPaymentChannel 

Fields

Instances

Show ReceiverPaymentChannelX Source # 
Show ReceiverPaymentChannel Source # 
PaymentChannel ReceiverPaymentChannel Source # 
Eq pkInfo => Eq (ReceiverPaymentChannelI pkInfo) Source # 

type Hour = Tagged "Hour" Word32 Source #

newtype BitcoinAmount Source #

Represents a bitcoin amount as number of satoshis. 1 satoshi = 1e-8 bitcoin. 1e8 satohis = 1 bitcoin. Only amounts >= 0 can be represented, and fromInteger caps to a Word64. It is thus not possible to eg. construct a negative BitcoinAmount which, when added to another BitcoinAmount, subtracts from its value. Adding two large amounts together will never overflow, nor will subtraction underflow.

Constructors

BitcoinAmount Integer 

Instances

Bounded BitcoinAmount Source # 
Enum BitcoinAmount Source # 
Eq BitcoinAmount Source # 
Integral BitcoinAmount Source # 
Num BitcoinAmount Source # 
Ord BitcoinAmount Source # 
Real BitcoinAmount Source # 
Show BitcoinAmount Source # 
Serialize BitcoinAmount Source # 
HasFee BitcoinAmount Source #

For compatibility

capTo21Mill :: Integer -> Word64 Source #

Convert to 21 million, zero as floor

data BitcoinLockTime Source #

Data type representing a Bitcoin LockTime, which specifies a point in time. Derive a BitcoinLockTime from a UTCTime using fromDate.

Constructors

LockTimeBlockHeight Word32

A value of "n" represents the point in time at which Bitcoin block number "n" appears

LockTimeDate UTCTime

Specifies a point in time using a timestamp with 1-second accuracy

parseBitcoinLocktime :: Word32 -> BitcoinLockTime Source #

Convert from Bitcoin format (Word32)

toWord32 :: BitcoinLockTime -> Word32 Source #

Convert to Bitcoin format (uint32 UNIX timestamp)

class Serialize a => IsPubKey a where Source #

Types which contain a pubkey

Minimal complete definition

getPubKey

Methods

getPubKey :: a -> PubKeyC Source #

setClientChangeAddress :: PaymentChannelState -> Address -> PaymentChannelState Source #

Set new client/sender change address. Use this function if the client wishes to change its change address. First set the new change address using this function, then accept the payment which uses this new change address.

channelValueLeft :: PaymentChannelState -> BitcoinAmount Source #

We subtract the specified "dust" limit from the total available value. This avoids creating a Bitcoin transaction that won't circulate in the Bitcoin P2P network.

channelIsExhausted :: PaymentChannelState -> Bool Source #

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

Orphan instances