get recvd time for each utxo

This commit is contained in:
timlucmiptev 2020-12-02 14:01:49 +02:00 committed by ixv
parent b4214870db
commit 109d0a38fa
5 changed files with 7 additions and 5 deletions

View File

@ -6,7 +6,7 @@ The below requires norsyr's fix to `decompress-point` in order to work.
:btc-provider|command [%set-credentials api-url='http://localhost:50002']
:btc-provider|action ['blockfee' %ping ~]
:btc-provider|action ['addr0' %address-info [%bech32 'bc1q59u5epktervh6fxqay2dlph0wxu9hjnx6v8n66']]
:btc-provider|action ['addr0' %address-info [%bech32 'bc1qm7cegwfd0pvv9ypvz5nhstage00xkxevtrpshc']]
:btc-provider|action ['addr1' %address-info [%bech32 'bc1qlwd7mw33uea5m8r2lsnsrkc7gp2qynrxsfxpfm']]
:btc-provider|action ['addr2' %address-info [%bech32 'bc1qglkc9zfcn04vcc88nn0ljtxcpu5uxfznc3829k']]
:: first is an address w balance

View File

@ -163,6 +163,7 @@
::
[%raw-tx @ *]
?> ?=([%get-raw-tx *] resp)
:_ state
~[(send-update [%.y (get-req-id wire) %raw-tx +.resp])]
::

View File

@ -29,6 +29,7 @@
^- (unit @da)
?: =(0 secs) ~
[~ (add ~1970.1.1 `@dr`(mul secs ~s1))]
::
++ to-hex
|= h=@t
@ -93,7 +94,6 @@
:~ [%utxos (as:dejs:format utxo)]
[%used bo:dejs:format]
[%block ni:dejs:format]
[%time (cu:dejs:format from-epoch ni:dejs:format)]
==
++ utxo
%- ot:dejs:format
@ -101,6 +101,7 @@
['tx_hash' (cu:dejs:format to-hash256 so:dejs:format)]
[%height ni:dejs:format]
[%value ni:dejs:format]
[%recvd (cu:dejs:format from-epoch ni:dejs:format)]
==
++ raw-tx
%- ot:dejs:format

View File

@ -14,7 +14,7 @@
==
+$ result [=req-id body=result-body]
+$ result-body
$% [%address-info utxos=(set utxo) used=? block=@ud time=(unit @da)]
$% [%address-info utxos=(set utxo) used=? block=@ud]
[%raw-tx =txid =rawtx]
==
+$ error
@ -41,7 +41,7 @@
==
::
+$ response
$% [%get-address-info utxos=(set utxo) used=? block=@ud time=(unit @da)]
$% [%get-address-info utxos=(set utxo) used=? block=@ud]
[%get-raw-tx =txid =rawtx]
[%get-block-count block=@ud]
[%get-block-and-fee block=@ud fee=sats]

View File

@ -14,7 +14,7 @@
+$ txid hash256
+$ rawtx btc-byts
+$ buffer (list @ux)
+$ utxo [pos=@ =txid height=@ value=sats]
+$ utxo [pos=@ =txid height=@ value=sats recvd=(unit @da)]
++ address-info
$: =address
confirmed-value=sats