mirror of
https://github.com/ilyakooo0/urbit.git
synced 2024-09-20 15:08:34 +03:00
btc: add balance events on handle-address-info
This commit is contained in:
parent
84ccb732e6
commit
4a0caa9fc3
@ -957,6 +957,7 @@
|
|||||||
[cad ah]
|
[cad ah]
|
||||||
:- [(poke-provider [%tx-info txid.u]) cad]
|
:- [(poke-provider [%tx-info txid.u]) cad]
|
||||||
(~(put by ah) txid.u)
|
(~(put by ah) txid.u)
|
||||||
|
=. cards (snoc cards (give-update %balance current-balance))
|
||||||
:: if the wallet+chyg is being scanned, update the scan batch
|
:: if the wallet+chyg is being scanned, update the scan batch
|
||||||
::
|
::
|
||||||
=/ b (~(get by scans) [xpub.w chyg])
|
=/ b (~(get by scans) [xpub.w chyg])
|
||||||
|
@ -107,6 +107,7 @@
|
|||||||
%new-tx (hest hest.upd)
|
%new-tx (hest hest.upd)
|
||||||
%cancel-tx (hexb txid.upd)
|
%cancel-tx (hexb txid.upd)
|
||||||
%new-address (address address.upd)
|
%new-address (address address.upd)
|
||||||
|
%balance (balance balance.upd)
|
||||||
==
|
==
|
||||||
::
|
::
|
||||||
++ initial
|
++ initial
|
||||||
|
@ -118,7 +118,7 @@
|
|||||||
$% $: %initial
|
$% $: %initial
|
||||||
provider=(unit provider)
|
provider=(unit provider)
|
||||||
wallet=(unit xpub)
|
wallet=(unit xpub)
|
||||||
balance=(unit [p=sats q=sats])
|
balance=(unit [confirmed=sats unconfirmed=sats])
|
||||||
=history
|
=history
|
||||||
=btc-state
|
=btc-state
|
||||||
address=(unit address)
|
address=(unit address)
|
||||||
@ -130,6 +130,7 @@
|
|||||||
[%new-tx =hest]
|
[%new-tx =hest]
|
||||||
[%cancel-tx =txid]
|
[%cancel-tx =txid]
|
||||||
[%new-address =address]
|
[%new-address =address]
|
||||||
|
[%balance balance=(unit [confirmed=sats unconfirmed=sats])]
|
||||||
==
|
==
|
||||||
::
|
::
|
||||||
+$ condition
|
+$ condition
|
||||||
|
@ -33,6 +33,9 @@ export class UpdateReducer {
|
|||||||
if (json.address) {
|
if (json.address) {
|
||||||
this.reduceAddress(json.address, state);
|
this.reduceAddress(json.address, state);
|
||||||
}
|
}
|
||||||
|
if (json.balance) {
|
||||||
|
this.reduceBalance(json.balance, state);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
reduceProviderStatus(json, state) {
|
reduceProviderStatus(json, state) {
|
||||||
@ -91,4 +94,9 @@ export class UpdateReducer {
|
|||||||
reduceAddress(json, state) {
|
reduceAddress(json, state) {
|
||||||
state.address = json;
|
state.address = json;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
reduceBalance(json, state) {
|
||||||
|
state.unconfirmedBalance = json.unconfirmed;
|
||||||
|
state.confirmedBalance = json.confirmed;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user