shrub/sur/btc-provider.hoon

52 lines
1.2 KiB
Plaintext
Raw Normal View History

2020-10-12 11:26:43 +03:00
/- *btc, bnh=btc-node-hook
2020-10-01 16:51:37 +03:00
|%
2020-10-13 12:25:37 +03:00
+$ btc-credentials [rpc-url=@t rpc-user=@t rpc-password=@t]
+$ electrum-credentials [rpc-url=@t]
+$ credentials [bc=btc-credentials ec=electrum-credentials]
+$ status [creds=credentials connected=? clients=(set ship)]
2020-10-01 16:51:37 +03:00
+$ action
2020-10-20 12:05:37 +03:00
$% [%get-address-info =address]
==
+$ response
$% [%block-count count=@]
2020-10-20 12:05:37 +03:00
[%get-address-info info=address-info]
[%get-balance (set [=address balance=sats])]
[%get-transactions ~]
==
+$ update :: sub updates from /clients path (connection etc.)
$% [%status connected=?]
2020-10-05 15:21:23 +03:00
==
::
+$ command
$% [%set-credentials creds=credentials]
[%whitelist-clients clients=(set ship)]
2020-10-01 16:51:37 +03:00
==
2020-10-12 11:26:43 +03:00
+$ rpc-action
2020-10-13 12:25:37 +03:00
$% [%erpc request:electrum:rpc]
[%brpc request:bitcoin-core:rpc]
2020-10-12 11:26:43 +03:00
==
2020-10-20 13:44:31 +03:00
+$ rpc-response
$% [%erpc response:electrum:rpc]
[%brpc response:bitcoin-core:rpc]
==
2020-10-12 11:26:43 +03:00
++ rpc
|%
++ electrum
|%
2020-10-13 12:25:37 +03:00
+$ request
$% [%get-address-balance =address]
2020-10-20 12:05:37 +03:00
[%get-address-utxos =address]
2020-10-12 11:26:43 +03:00
==
2020-10-20 13:44:31 +03:00
+$ response
$% [%get-address-utxos utxos=(set utxo)]
==
2020-10-12 11:26:43 +03:00
--
++ bitcoin-core
|%
2020-10-13 12:25:37 +03:00
+$ request btc-node-hook-action:bnh
2020-10-20 13:44:31 +03:00
+$ response btc-node-hook-response:bnh
2020-10-12 11:26:43 +03:00
--
--
2020-10-01 16:51:37 +03:00
--
2020-10-13 12:25:37 +03:00