Skip to content

Commit

Permalink
wip api
Browse files Browse the repository at this point in the history
  • Loading branch information
rvl committed Aug 13, 2020
1 parent d23a80d commit 86273d4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/core/src/Cardano/Wallet/Api/Server.hs
Original file line number Diff line number Diff line change
Expand Up @@ -1331,9 +1331,11 @@ mkApiTransactionFromInfo ti (TransactionInfo txid ins outs ws meta depth txtime)
case meta ^. #status of
Pending -> #pendingSince
InLedger -> #insertedAt
Expired -> #expiresAt
return $ case meta ^. #status of
Pending -> apiTx
InLedger -> apiTx { depth = Just depth }
Expired -> apiTx
where
drop2nd (a,_,c) = (a,c)

Expand Down Expand Up @@ -1797,6 +1799,7 @@ mkApiTransaction ti txid ins outs ws (meta, timestamp) setTimeReference = do
, amount = meta ^. #amount
, insertedAt = Nothing
, pendingSince = Nothing
, expiresAt = Nothing
, depth = Nothing
, direction = ApiT (meta ^. #direction)
, inputs = [ApiTxInput (fmap toAddressAmount o) (ApiT i) | (i, o) <- ins]
Expand Down
1 change: 1 addition & 0 deletions lib/core/src/Cardano/Wallet/Api/Types.hs
Original file line number Diff line number Diff line change
Expand Up @@ -546,6 +546,7 @@ data ApiTransaction (n :: NetworkDiscriminant) = ApiTransaction
, amount :: !(Quantity "lovelace" Natural)
, insertedAt :: !(Maybe ApiTimeReference)
, pendingSince :: !(Maybe ApiTimeReference)
, expiresAt :: !(Maybe ApiTimeReference)
, depth :: !(Maybe (Quantity "block" Natural))
, direction :: !(ApiT Direction)
, inputs :: ![ApiTxInput n]
Expand Down

0 comments on commit 86273d4

Please sign in to comment.