O>      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~      NoneIAn account on the wallet is just a label to easily specify private keys. (The default account is an empty string. I don'Ct know what this is. A signature of some sort? If you know, please - submit a patch documenting this properly! +An address for sending or receiving money. BThe type of bitcoin money, represented with a fixed-point number. GA satoshi is the smallest subdivision of bitcoins. For the resolution,  use  from   . CA hexadecimal string representation of a 256-bit unsigned integer. 1This integer is a unique transaction identifier. AA string returned by the bitcoind API, representing data as hex. AWhat that data represents depends on the API call, but should be  dcumented accordingly. A  is thrown when 'callApi encounters an 3 error. The API error code is represented as an Int, the message as  a String. EIt may also be thrown when the value returned by the bitcoin API wasn't  what we expected. ,WARNING: Any of the functions in this module's public API may throw this 7 exception. You should plan on handling it.  The raw JSON returned, if we can't figure out what  actually went wrong. A  has an error code error # message, as returned by bitcoind' s JSON-RPC  response. * describes authentication credentials for , making API requests to the Bitcoin daemon. 'URL, with port, where bitcoind listens same as bitcoind's rpcuser config same as bitcoind's  rpcpassword config        None HA wrapper for a vector of address:amount pairs. The RPC expects that as  an object of address:amount$ pairs, instead of a vector. So that's what  we give them with AddrAddress' s ToJSON. Used to allow null to decode to a tuple. KA response from bitcoind will contain the result of the JSON-RPC call, and H an error. The error should be null if a valid response was received. ERPC calls return an error object. It can either be empty; or have an  error message + error code. Error code + error message.  All good. The no conversion needed0 implementation of callApi. THis lets us inline L and specialize callApi for its parameters, while keeping the bulk of the ! work in this function shared. 7 is a low-level interface for making authenticated API ; calls to a Bitcoin daemon. The first argument specifies A authentication details (URL, username, password) and is often  curried for convenience:  D callBtc = callApi $ Auth "http://127.0.0.1:8332" "user" "password" FThe second argument is the command name. The third argument provides  parameters for the API call.  ? let result = callBtc "getbalance" [ tj "account-name", tj 6 ] On error, throws a . 8Internal helper functions to make callApi more readable Builds the JSON HTTP request. &A handy shortcut for toJSON, because I'm lazy.  !"(authentication credentials for bitcoind  command name command arguments #$%&    !"#$%&None-Details about an unspent transaction output. "9The number of times this transaction has been confirmed. #The amount transferred. $The public key of the sender. %!The version of this transaction. &+Is this transaction part of the coin base? ':Information on the unspent transaction in the output set. *.The number of transactions in the output set. +,The number of outputs for the transactions. ,'The serialized size of the output set. -4Information about a given block in the block chain. 0+The number of confirmations the block has. 1The size of the block. 2The height# of the block. TODO: Clarify this. 3The version of the block. 45The hash of the block at the root of the merkle tree  which this block belongs to. 51Should this be a transaction, or transaction id? 6The time it was mined. 7 The block' s nonce. 9!How hard was this block to mine? :*A pointer to the next block in the chain. ;.A pointer to the previous block in the chain. <The hash of a given block. =9Returns the number of blocks in the longest block chain. >BReturns the proof-of-work difficulty as a multiple of the minimum  difficulty. ?GSets the transaction fee will will pay to the network. Values of 0 are  rejected. @8Returns all transaction identifiers in the memory pool. AFReturns the hash of the block in best-block-chain at the given index. B2Returns details of a block with given block-hash. C=Returns statistics about the unspent transaction output set. D5Returns details about an unspent transaction output. ) !"#$%&'()*+,-./0123456789:;<=>?@A Block index. BCD The index we're looking at. '()1  !"#$%&'()*+,-./0123456789:;<=>?@ABCD1 =>?@<A-./0123456789:;B'()*+,C !"#$%&D !"#$%&'()*+,-./0123456789:;<=>?@ABCD'()NoneE3A textual representation of a bitcoin private key. F@Adds a private key (as returned by dumpprivkey) to your wallet. G<Reveals the private key corresponding to the given address. EFAn optional label for the key. GEFGEFGEFGNone"*EUnfortunately, the submitblock API call returns null on success, and  the string rejected on failure. We use * to parse this ridiculous API. H0A template for constructing a block to work on. See  #https://en.bitcoin.it/wiki/BIP_0022 for the full specification. KHash of current highest block. L5Contents of non-coinbase transactions that should be  included in the next block. M*Data that should be included in coinbase. N1Maximum allowable input to coinbase transaction, 8 including the generation award and transaction fees. O Hash target. P.Minimum timestamp appropriate for next block. QRange of valid nonces. RLimit of sigops in blocks. SLimit of block size. TCurrent timestamp. U%Compressed target of the next block. VHeight of the next block. Z0A transaction to be included in the next block. aThe hash data returned from w. d>Little-endian hash target, formatted as a hexadecimal string. g>Information related to the current bitcoind mining operation. #If a field is undocumented here, it's because I don't know what it means. " If you DO know what it means, I')d love it if you would submit a patch to % help complete this documentation. i)The number of blocks in our block-chain. j The size of the current block we' re mining. l#How difficult mining currently is. m)Any mining errors that may have come up. n&Are we currently generating bitcoins? o7How many processors have we limited bitcoin mining to? pHow fast is the mining going? r;Are we on the bitcoin test network (as opposed to the real  thing)? s8Returns whether or not bitcoind is generating bitcoins. t9Controls whether or not bitcoind is generating bitcoins. uAReturns a recent hashes per second performance measurement while  generating. v9Returns an object containing mining-related information. w(Returns formatted hash data to work on. xGTries to solve the given block, and returns true if it was successful. y5Returns data needed to construct a block to work on. z/Attempts to submit a new block to the network. =*+,HIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrsbitcoind RPC authorization tbitcoind RPC authorization Turn it on, or turn it off? (Generation is limited to this number of 3 processors. Set it to Nothing to keep the value - at what it was before, Just -1 to use all 5 available cores, and any other value to limit it. uvwxyzThe block to submit. 'Was the block accepted by the network? -./01238HIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz8stughijklmnopqrvabcdefwxZ[\]^_`WXYHIJKLMNOPQRSTUVyz*+,HIJKLMNOPQRSTUVWXYZ[\]^_`abcdefg hijklmnopqrstuvwxyz-./0123None {6Information about a peer node of the Bitcoin network. GThe documentation for this data structure is incomplete, as I honestly  don'?t know what some of these fields are for. Patches are welcome! }'The IP:port of this peer, as a string. >Relative to the first time we conected with this peer (and in : milliseconds), the last time we sent this peer any data. 7Relative to the first time we connected with this peer > (and in milliseconds), the last time we sent this peer any  data. 1How long have we been connected to this peer (in  milliseconds). 7The version of the Bitcion client the peer is running. ;The sub-version of the Bitcoin client the peer is running. ,How many times has this peer behaved badly? 2Returns the number of connections to other nodes. -Returns data about all connected peer nodes. {|}~4{|}~{|}~{ |}~4None-KA raw signed transaction contains the raw, signed hexstring and whether or 6 not this transaction has a complete signature set. %Who can pay for a given transaction. 5Used internally to give a new 6 instance for . AA successfully decoded raw transaction, from a given serialized,  hex-encoded transaction. The raw transaction.  The transaction version number. The vector of transactions in.  The vector of transactions out. 5The raw transaction info for a given transaction ID. The raw transaction.  The transaction version number. The vector of transactions in.  The vector of transactions out. -The hash of the block that was used for this  transaction. The transaction's block's info. Information on a single block. 3An unconfirmed block is boring, but a possibility. )The number of confirmations a block has.  This will always be >= 1.  The JSON  blocktime field. !A transaction out of an account. 'The amount of bitcoin transferred out. 4The public key of the account we sent the money to. *A public key of someone we sent money to.  The JSON asm field.  The JSON hex field. #The number of required signatures. The type of the transaction. (The addresses associated with this key.  The JSON asm field.  The JSON hex field. The type of a transaction out. KMore documentation is needed here. Submit a patch if you know what this is  about! JSON of multisig received. JSON of  scripthash received. JSON of  pubkeyhash received. JSON of pubkey received. JA transaction into an account. This can either be a coinbase transaction, 3 or a standard transaction with another account. This transaction's ID. A transaction sequence number. IJust like most binary data retrieved from bitcoind, a raw transaction is  represented by a hexstring. /This is a serialized, hex-encoded transaction. *Get a raw transaction from its unique ID. HGet raw transaction info for a given transaction ID. The data structure H returned is quite sprawling and undocumented, so any patches to help 1 simplify things would be greatly appreciated. IReturns an array of unspent transaction outputs with between minconf and N maxconf (inclusive) confirmations. If addresses are given, the result will 0 be filtered to include only those addresses. HCreate a transaction spending given inputs, sending to given addresses. Note that the transaction'.s inputs are not signed, and it is not stored 0 in the wallet or transmitted to the network. 'Also, there is no checking to see if it' s possible to send that much to H the targets specified. In the future, such a scenario might throw an  exception. ADecodes a raw transaction into a more accessible data structure. #Sign inputs for a raw transaction. Z57minconf. Defaults to 1 if 8.  maxconf. Defaults to 9999999 if 8. Use    for no filtering. The unspent transactions we'll be using as our output. The addresses we'$re sending money to, along with how  much each of them gets. 9#The raw transaction whose inputs we' re signing. 6An optional list of previous transaction outputs that 9 this transaction depends on but may not yet be in the  block chain. 8An array of base58-encoded private keys that, if given, 7 will be the only keys used to sign the transaction. "Who can pay for this transaction?  by default. Returns 8' if the transaction has a complete set , of signatures, and the raw signed transa :;<=>?@ABCDUU57 9:;<=>?@ABCDNone<E-Just a handy wrapper to help us get only the isvalid field of the JSON. B The structure is much too complicated for what it needs to do. The account we received into. The mount received. 2 ^ The number of confirmations of the most recent  included transaction. 9Information on how much was received by a given address. .The address which the money was deposited to. +The account which this address belongs to. The amount received. /The number of confirmations of the most recent  included transaction. )A signature is a base-64 encoded string.  Information on a given address. The address in question.  The address' balance.  The address' linked account. 5A plethora of information about a bitcoind instance. )What version of bitcoind are we running? What is bitcoind's current protocol number? What version is the wallet? +How much money is currently in the wallet? #The number of blocks in our chain. $How many peers are we connected to? A blank string if we're not using a proxy. 9The difficulty multiplier for bitcoin mining operations. 6Are we on the test network (as opposed to the primary  bitcoin network)? 1The timestamp of the oldest key in the key pool. The size of the key pool. 3How much do we currently pay as a transaction fee? 9If the wallet is unlocked, the number of seconds until a  re-lock is needed. 9Any alerts will show up here. This should normally be an  empty string. 1Returns an object containing various state info. 6Returns a new bitcoin address for receiving payments. JIf an account is specified (recommended), the new address is added to the N address book so payments received with the address will be credited to the  given account. HIf no account is specified, the address will be credited to the account = whose name is the empty string. i.e. the default account. HReturns the current Bitcoin address for receiving payments to the given  account. 4Sets the account associated with the given address. 7Returns the account associated with the given address. 5Returns the list of addresses for the given address. #Sends some bitcoins to an address. ELists groups of addresses which have had their common ownership made E public by common use as inputs or as the resulting change in past  transactions. 3Sign a message with the private key of an address. Verifies a signed message. IReturns the total amount received by the given address with at least one  confirmation. JReturns the total amount received by the given address, with at least the ! give number of confirmations. EReturns the total amount received by address with the given account. GReturns the total amount received by addresses with the given account, N counting only transactions with the given minimum number of confirmations. Returns the server's total available balance. JReturns the balance in the given account, counting only transactions with  at least one confirmation. JReturns the balance in the given account, counting only transactions with / at least the given number of confirmations. :Move bitcoins from one account in your wallet to another. CIf you want to send bitcoins to an address not in your wallet, use   .  FSends bitcoins from a given account in our wallet to a given address. =A transaction and sender comment may be optionally provided.  *Send to a whole bunch of address at once.  KLists the amount received by each address which has received money at some E point, counting only transactions with at least one confirmation.  AList the amount received by each of our addresses, counting only @ transactions with the given minimum number of confirmations.  KLists the amount received by each account which has received money at some F point, counting only transactions with at leaset one confirmation. @List the amount received by each of our accounts, counting only @ transactions with the given minimum number of confirmations. ISafely copies wallet.dat to the given destination, which can be either a ' directory, or a path with filename. Fills the keypool. IStores the wallet decryption key in memory for the given amount of time. Changes the wallet passphrase. CRemoves the wallet encryption key from memory, locking the wallet. 3After calling this function, you will need to call  again N before being able to call methods which require the wallet to be unlocked. 0Note: In future releases, we might introduce an unlocked monad, so - locking and unlocking is automatic. /Encrypts the wallet with the given passphrase. ?WARNING: bitcoind will shut down after calling this method. Don't say I  didn' t warn you. *Checks if a given address is a valid one. FWhat a silly API. HEGHWho we're sending to. The amount to send. )An optional comment for the transaction. :An optional comment-to (who did we sent this to?) for the  transaction.  The address whose private key we'll use. The message to sign. $The address of the original signer.  The message' s signature.  The message. Was the signature valid? +The minimum number of confirmations needed - for a transaction to to count towards the  total. The account in question. 1The minimum number of confirmations needed for a + transaction to count towards the total. =The minimum number of confirmations needed for a transaction  to count towards the total. From. To. The amount to transfer. )A comment to record for the transaction.  The account to send from. The address to send to. The amount to send. !An optional transaction comment. 2An optional comment on who the money is going to.  The account to send from. /The address, and how much to send to each one. !An optional transaction comment.   -The minimum number of confirmations before a . transaction counts toward the total amount  received. *Should we include addresses with no money  received?  -The minimum number of confirmations before a 1 transaction counts toward the total received. -Should we include the accounts with no money  received? The decryption key. 2How long to store the key in memory (in seconds). The old password. The new password. IJKFLE     E     *EGH     IJKFL None  !"#$%&'()*+,-./0123456789:;<=>?@ABCDFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~       =>?@<A-./0123456789:;B'()*+,C !"#$%&DFGstughijklmnopqrvabcdefwxZ[\]^_`WXYHIJKLMNOPQRSTUVyz{|}~     M  !"##$%&'())*+,-../01234556789::;<=>?@ABCDEFGHIJKLMNOPQRSTTUVWXYZ[\]^_`abbcddefghijjklmnoopqrstuvwxyz{|}~      !"#$%&'()*+,-./0123456789:;<=>?@ABCBDEFGHInetwork-bitcoin-1.2.1Network.Bitcoin.InternalNetwork.Bitcoin.TypesNetwork.Bitcoin.BlockChainNetwork.Bitcoin.DumpNetwork.Bitcoin.MiningNetwork.Bitcoin.NetNetwork.Bitcoin.RawTransactionNetwork.Bitcoin.WalletDataFixed Data.VectoremptyNetwork.Bitcoin text-0.11.3.1Data.Text.InternalText aeson-0.6.1.0Data.Aeson.Types.Class parseJSONFromJSONvector-0.10.0.1VectorAccount ScriptSigsigAsmsigHexAddressBTCSatoshi TransactionID HexStringBitcoinExceptionBitcoinResultTypeErrorBitcoinApiErrorAuthrpcUrlrpcUser rpcPassword AddrAddressAANilunNilcallApi'callApitj OutputInfo oiBestBlockoiConfirmationsoiAmountoiScriptPubKey oiVersion oiCoinBase OutputSetInfo osiBestBlocknumTransactionstransactionOutputsserializedSizeBlock blockHashblkConfirmationsblkSize blkHeight blkVersion merkleRootsubTransactionsblkTimeblkNonceblkBits blkDifficulty nextBlock prevBlock BlockHash getBlockCount getDifficultysetTransactionFeegetRawMemoryPool getBlockHashgetBlockgetOutputSetInfo getOutputInfo PrivateKeyimportPrivateKeydumpPrivateKey BlockTemplate blockVersionpreviousBlockHashtransactionsToInclude coinBaseAux coinBaseValuebtTargetminTime nonceRange sigopLimit sizeLimitcurTimebtBitsbtHeight CoinBaseAuxcbFlags TransactiontxnDatatxnHashdependstxnFeesigOpsHashData blockDatahdTargethash1midstate MiningInfonBlockscurrentBlockSizecurrentBlockTransaction difficulty miningErrors isGeneratinggenerationProcessorLimithashesPerSecondpooledTransactionsminingOnTestNetwork getGenerate setGenerategetHashesPerSec getMiningInfogetWork solveBlockgetBlockTemplate submitBlockPeerInfo addressNameserviceslastSendlastRecvconnectionTime peerVersionpeerSubversioninbound releaseTimestartingHeightbanScoregetConnectionCount getPeerInfoRawSignedTransaction rawSignedhasCompleteSigSet WhoCanPaySingleOrAnyoneCanPaySingleNoneOrAnyoneCanPayNoneAllOrAnyoneCanPayAllDecodedRawTransactiondecRaw decTxnVersiondecTxnLockTimedecVindecVoutUnspentTransactionunspentTransactionIdoutIdxunspentScriptPubKey redeemScript unspentAmountusConfirmationsRawTransactionInforaw txnVersion txnLockTimevinvoutrawTxBlockHash rawBlockInfo BlockInfoUnconfirmedBlockConfirmedBlock confirmationscbTime blockTimeTxOuttxoutVal scriptPubKey ScriptPubKeyStandardScriptPubKeysspkAsmsspkHex requiredSigssspkType sspkAddressesNonStandardScriptPubKeynspkAsmnspkHex TxnOutputType TxnMultisig TxnScriptHash TxnPubKeyHash TxnPubKeyTxIntxInIdnumOut scriptSig txSequence TxCoinbase txCoinbaseRawTransactiongetRawTransactiongetRawTransactionInfo listUnspentcreateRawTransactiondecodeRawTransactionsignRawTransactionsendRawTransactionReceivedByAccount raccAccount raccAmountraccNumConfirmationsReceivedByAddress recvAddress recvAccount recvAmountrecvNumConfirmations Signature AddressInfo aiAddressaiAmount aiAccount BitcoindInfobitcoinVersionprotocolVersion walletVersionbalance numBlocksnumConnectionsproxygenerationDifficulty onTestNetwork keyPoolOldest keyPoolSizetransactionFeePaid unlockedUntilbitcoindErrorsgetBitcoindInfo getNewAddressgetAccountAddress setAccount getAccountgetAddressesByAccount sendToAddresslistAddressGroupings signMessage verifyMessagegetReceivedByAddressgetReceivedByAddress'getReceivedByAccountgetReceivedByAccount' getBalance getBalance' getBalance'' moveBitcoinssendFromAccountsendManylistReceivedByAddresslistReceivedByAddress'listReceivedByAccountlistReceivedByAccount' backupWallet keyPoolRefill unlockWalletchangePassword lockWallet encryptWalletisAddressValidbase Data.Fixed resolution$fFromJSONScriptSig$fHasResolutionSatoshi$fExceptionBitcoinExceptionBitcoinRpcResponseBitcoinRpcErrorNoError httpAuthority httpRequest btcResultbtcError$fToJSONAddrAddress $fFromJSONNil$fFromJSONBitcoinRpcResponse$fFromJSONBitcoinRpcError$fFromJSONOutputInfo$fFromJSONOutputSetInfo$fFromJSONBlockStupidReturnValueSRVunStupid$fFromJSONStupidReturnValue$fFromJSONBlockTemplate$fFromJSONCoinBaseAux$fFromJSONTransaction$fToJSONHashData$fFromJSONHashData$fFromJSONMiningInfo$fFromJSONPeerInfoUnspentForSigningToJSONUFS Data.MaybeNothingtoString$fFromJSONRawSignedTransaction$fToJSONUnspentForSigning$fFromJSONDecodedRawTransaction$fToJSONUnspentTransaction$fFromJSONUnspentTransaction$fFromJSONRawTransactionInfo$fFromJSONBlockInfo$fFromJSONTxOut$fFromJSONScriptPubKey$fFromJSONTxnOutputType$fFromJSONTxInIsValid$fFromJSONAddressInfogetValid$fFromJSONIsValid$fFromJSONReceivedByAccount$fFromJSONReceivedByAddress$fFromJSONBitcoindInfo