haskoin-store 0.14.8 → 0.14.9
raw patch · 4 files changed
+19/−2 lines, 4 files
Files
- CHANGELOG.md +4/−0
- haskoin-store.cabal +2/−2
- src/Haskoin/Store.hs +4/−0
- src/Network/Haskoin/Store/Data.hs +9/−0
CHANGELOG.md view
@@ -4,6 +4,10 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). +## 0.14.9+### Added+- Last external/change index information to `XPubSummary` object.+ ## 0.14.8 ### Added - Endpoint for xpub summaries.
haskoin-store.cabal view
@@ -4,10 +4,10 @@ -- -- see: https://github.com/sol/hpack ----- hash: 807e40f322a2b27c961a0296734a984a32c4f1fa0b9a3613acc3c1661f085a9a+-- hash: 617a58a17a5d91918490076dcbe3d80c11fa8480befcac0e5afff71309398fa2 name: haskoin-store-version: 0.14.8+version: 0.14.9 synopsis: Storage and index for Bitcoin and Bitcoin Cash description: Store blocks, transactions, and balances for Bitcoin or Bitcoin Cash, and make that information via REST API. category: Bitcoin, Finance, Network
src/Haskoin/Store.hs view
@@ -454,6 +454,8 @@ , a <- ais ++ aos ] ps = H.fromList $ mapMaybe (\a -> (a, ) <$> H.lookup a pm) as+ ex = foldl max 0 [i | XPubBal {xPubBalPath = [x, i]} <- bs, x == 0]+ ch = foldl max 0 [i | XPubBal {xPubBalPath = [x, i]} <- bs, x == 1] return XPubSummary { xPubSummaryReceived =@@ -462,6 +464,8 @@ , xPubSummaryZero = sum (map (balanceZero . xPubBal) bs) , xPubSummaryPaths = ps , xPubSummaryTxs = txs+ , xPubChangeIndex = ch+ , xPubExternalIndex = ex } -- | Check if any of the ancestors of this transaction is a coinbase after the
src/Network/Haskoin/Store/Data.hs view
@@ -828,6 +828,8 @@ { xPubSummaryReceived :: !Word64 , xPubSummaryConfirmed :: !Word64 , xPubSummaryZero :: !Word64+ , xPubExternalIndex :: !Word32+ , xPubChangeIndex :: !Word32 , xPubSummaryPaths :: !(HashMap Address [KeyIndex]) , xPubSummaryTxs :: ![Transaction] }@@ -839,9 +841,12 @@ , xPubSummaryZero = z , xPubSummaryPaths = ps , xPubSummaryTxs = ts+ , xPubExternalIndex = ext+ , xPubChangeIndex = ch } = [ "balance" .= object ["received" .= r, "confirmed" .= c, "unconfirmed" .= z]+ , "indices" .= object ["change" .= ch, "external" .= ext] , "paths" .= object (mapMaybe (uncurry f) (H.toList ps)) , "txs" .= map (transactionToJSON net) ts ]@@ -862,12 +867,16 @@ binSerial net XPubSummary { xPubSummaryReceived = r , xPubSummaryConfirmed = c , xPubSummaryZero = z+ , xPubExternalIndex = ext+ , xPubChangeIndex = ch , xPubSummaryPaths = ps , xPubSummaryTxs = ts } = do put r put c put z+ put ext+ put ch putWord64be (fromIntegral $ H.size ps) forM_ (H.toList ps) $ \(a, p) -> do binSerial net a