WIP: types as each

This commit is contained in:
timlucmiptev 2020-10-28 15:20:24 +02:00 committed by ixv
parent 8be29efaed
commit 7b00d8c99e
5 changed files with 35 additions and 12 deletions

View File

@ -1,6 +1,11 @@
:: btc-provider.hoon
:: Proxy that serves a BTC full node and ElectRS address indexer
::
:: Subscriptions: none
:: To Subscribers:
:: current connection state
:: results/errors of RPC calls
::
/+ *btc-provider, dbug, default-agent
|%
+$ versioned-state
@ -110,7 +115,7 @@
~& > "before"
?^ e
:_ state(connected.host-info %.n)
~[(send-update [%error u.e])]
~[(send-update [%| u.e])]
~& > "after"
=/ rpc-resp=response:rpc:jstd
(get-rpc-response response)

View File

@ -1,5 +1,11 @@
:: btc-wallet-hook.hoon
::
::
:: Subscriptions:
:: btc-provider:
:: connection status
:: RPC call results/errors
:: To Subscribers:
:: none
::
/- *btc-wallet-hook
/+ shoe, dbug, default-agent

View File

@ -1,6 +1,10 @@
:: btc-wallet-store.hoon
:: Manages wallet pubkeys
::
:: Subscriptions: none
:: To Subscribers:
:: watched address updates
::
/+ dbug, default-agent
|%
+$ versioned-state

View File

@ -13,10 +13,7 @@
+$ error
$% [%not-connected ~]
==
+$ update :: sub updates from /clients path (connection etc.)
$% [%result =result]
[%error =error]
==
+$ update (each result error) :: sub updates from /clients path (connection etc.)
::
+$ command
$% [%set-credentials creds=credentials]

View File

@ -1,11 +1,22 @@
:: wallets are compatible with BIPs 44, 49, and 84
:: m / purpose' / coin_type' / account' / change / address_index
::
/- *btc, bip32
|%
+$ wallet
$: xpub=tape
root-path=tape
:: indices-0 is main account, indices-1 is change account
:: wilt: copulates with thousands of indices to form addresses
:: walt: wallet metadata
::
+$ wilt _bip32
+$ walt
$: :: scanned: whether we've checked all addresses for prior activity
:: ching: non-change addresses
:: chang: change addresses
:: watch: address -> [change address_index]
::
indices-0=((mop @ address-info) gth)
indices-1=((mop @ address-info) gth)
=wilt
scanned=?
ching=((mop @ address-info) gth)
chang=((mop @ address-info) gth)
watch=(map address [change=@ index=@])
==
--