support unit for meta payment info

This commit is contained in:
timlucmiptev 2020-11-19 11:45:05 +02:00 committed by ixv
parent 663aacbc23
commit df5107a4a8
4 changed files with 15 additions and 10 deletions

View File

@ -182,6 +182,7 @@
++ send-status ++ send-status
|= =status ^- card |= =status ^- card
[%give %fact ~[/clients] %btc-provider-status !>(status)] [%give %fact ~[/clients] %btc-provider-status !>(status)]
::
++ send-update ++ send-update
|= =update |= =update
^- card ^- card

View File

@ -136,14 +136,12 @@
?. =(payee.act our.bowl) ?. =(payee.act our.bowl)
~[(poke-wallet-hook payee.act act)] ~[(poke-wallet-hook payee.act act)]
?~ def-wallet ~|("btc-wallet-hook: no def-wallet set" !!) ?~ def-wallet ~|("btc-wallet-hook: no def-wallet set" !!)
:~ %+ poke-wallet-store /[(scot %p src.bowl)]/[(scot %ud value.act)] ~[(poke-wallet-store / [%generate-address u.def-wallet %0 `[src.bowl value.act]])]
[%generate-address u.def-wallet %0]
==
:: ::
%pay-address %pay-address
:: TODO: update poym :: TODO: update poym
:: send tx request out for poym :: send tx request out for poym
:: TODO: ask wallet to generate tbxu for poym :: TODO: ask wallet to generate txbu for poym
`state `state
:: ::
%force-retry %force-retry
@ -203,12 +201,14 @@
^- (quip card _state) ^- (quip card _state)
?- -.upd ?- -.upd
%generate-address %generate-address
?> ?=([@ @ @ *] wire) :: TODO if there's meta, add to piym
=/ value=sats (slav %ud +<.wire)
=/ payer=ship (slav %p -.wire)
:: moons go in a jar with parent as the key :: moons go in a jar with parent as the key
:: this will let me implement moon rate-limiting :: this will let me implement moon rate-limiting
:: ::
?~ meta.upd
~& > address.upd
`state
=/ [payer=ship value=sats] u.meta.upd
=/ fam=ship =/ fam=ship
?: =(%earl (clan:title payer)) ?: =(%earl (clan:title payer))
(sein:title our.bowl now.bowl payer) (sein:title our.bowl now.bowl payer)

View File

@ -119,7 +119,7 @@
=/ [a=address:btc w=walt] =/ [a=address:btc w=walt]
~(gen-address wad u.uw chyg.act) ~(gen-address wad u.uw chyg.act)
:_ state(walts (~(put by walts) xpub.act w)) :_ state(walts (~(put by walts) xpub.act w))
~[[%give %fact ~[/updates] %btc-wallet-store-update !>([%generate-address a])]] ~[(send-update [%generate-address a meta.act])]
== ==
:: wallet scan algorithm: :: wallet scan algorithm:
:: Initiate a batch for each chyg, with max-gap idxs in it :: Initiate a batch for each chyg, with max-gap idxs in it
@ -258,4 +258,8 @@
|=(=utxo:btc value.utxo) |=(=utxo:btc value.utxo)
add add
(roll values add) (roll values add)
::
++ send-update
|= upd=update ^- card
[%give %fact ~[/updates] %btc-wallet-store-update !>(upd)]
-- --

View File

@ -57,11 +57,11 @@
+$ action +$ action
$% [%add-wallet =xpub scan-to=(unit scon) max-gap=(unit @ud) confs=(unit @ud)] $% [%add-wallet =xpub scan-to=(unit scon) max-gap=(unit @ud) confs=(unit @ud)]
[%address-info =xpub =chyg =idx utxos=(set utxo) used=? blockcount=@ud] [%address-info =xpub =chyg =idx utxos=(set utxo) used=? blockcount=@ud]
[%generate-address =xpub =chyg] [%generate-address =xpub =chyg meta=(unit [payer=ship value=sats])]
== ==
:: ::
+$ update +$ update
$% [%generate-address =address] $% [%generate-address =address meta=(unit [payer=ship value=sats])]
[%scan-done =xpub] [%scan-done =xpub]
== ==
:: ::