mirror of
https://github.com/urbit/shrub.git
synced 2024-12-19 16:51:42 +03:00
support unit for meta payment info
This commit is contained in:
parent
663aacbc23
commit
df5107a4a8
@ -182,6 +182,7 @@
|
||||
++ send-status
|
||||
|= =status ^- card
|
||||
[%give %fact ~[/clients] %btc-provider-status !>(status)]
|
||||
::
|
||||
++ send-update
|
||||
|= =update
|
||||
^- card
|
||||
|
@ -136,14 +136,12 @@
|
||||
?. =(payee.act our.bowl)
|
||||
~[(poke-wallet-hook payee.act act)]
|
||||
?~ def-wallet ~|("btc-wallet-hook: no def-wallet set" !!)
|
||||
:~ %+ poke-wallet-store /[(scot %p src.bowl)]/[(scot %ud value.act)]
|
||||
[%generate-address u.def-wallet %0]
|
||||
==
|
||||
~[(poke-wallet-store / [%generate-address u.def-wallet %0 `[src.bowl value.act]])]
|
||||
::
|
||||
%pay-address
|
||||
:: TODO: update poym
|
||||
:: send tx request out for poym
|
||||
:: TODO: ask wallet to generate tbxu for poym
|
||||
:: TODO: ask wallet to generate txbu for poym
|
||||
`state
|
||||
::
|
||||
%force-retry
|
||||
@ -203,12 +201,14 @@
|
||||
^- (quip card _state)
|
||||
?- -.upd
|
||||
%generate-address
|
||||
?> ?=([@ @ @ *] wire)
|
||||
=/ value=sats (slav %ud +<.wire)
|
||||
=/ payer=ship (slav %p -.wire)
|
||||
:: TODO if there's meta, add to piym
|
||||
:: moons go in a jar with parent as the key
|
||||
:: this will let me implement moon rate-limiting
|
||||
::
|
||||
?~ meta.upd
|
||||
~& > address.upd
|
||||
`state
|
||||
=/ [payer=ship value=sats] u.meta.upd
|
||||
=/ fam=ship
|
||||
?: =(%earl (clan:title payer))
|
||||
(sein:title our.bowl now.bowl payer)
|
||||
|
@ -119,7 +119,7 @@
|
||||
=/ [a=address:btc w=walt]
|
||||
~(gen-address wad u.uw chyg.act)
|
||||
:_ 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:
|
||||
:: Initiate a batch for each chyg, with max-gap idxs in it
|
||||
@ -258,4 +258,8 @@
|
||||
|=(=utxo:btc value.utxo)
|
||||
add
|
||||
(roll values add)
|
||||
::
|
||||
++ send-update
|
||||
|= upd=update ^- card
|
||||
[%give %fact ~[/updates] %btc-wallet-store-update !>(upd)]
|
||||
--
|
||||
|
@ -57,11 +57,11 @@
|
||||
+$ action
|
||||
$% [%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]
|
||||
[%generate-address =xpub =chyg]
|
||||
[%generate-address =xpub =chyg meta=(unit [payer=ship value=sats])]
|
||||
==
|
||||
::
|
||||
+$ update
|
||||
$% [%generate-address =address]
|
||||
$% [%generate-address =address meta=(unit [payer=ship value=sats])]
|
||||
[%scan-done =xpub]
|
||||
==
|
||||
::
|
||||
|
Loading…
Reference in New Issue
Block a user