refactor types into sur; initial types

This commit is contained in:
timlucmiptev 2020-10-05 14:57:50 +03:00 committed by ixv
parent 350c004411
commit a066d6f337
5 changed files with 17 additions and 11 deletions

View File

@ -43,7 +43,7 @@
?+ q.vase (on-poke:def mark vase) ?+ q.vase (on-poke:def mark vase)
%status %status
:_ this :_ this
~[[%pass / %agent [our.bowl %btc-node-hook] %poke %btc-node-hook-action !>([%get-block-count ~])]] ~[[%pass / %agent [our.bowl %btc-node-hook] %poke %btc-node-hook-action !>([%ping ~])]]
== ==
== ==
:: ::

View File

@ -1,10 +1,9 @@
:: btc-scratch.hoon :: btc-scratch.hoon
/- *btc
/+ bip32, btc /+ bip32, btc
=+ ecc=secp256k1:secp:crypto =+ ecc=secp256k1:secp:crypto
=, bech32:btc =, bech32:btc
|% |%
+$ bech32-address $%([%bech32 tape])
+$ address ?(@uc bech32-address)
++ bip84 ++ bip84
|_ [network=network:btc xpub=tape] |_ [network=network:btc xpub=tape]
++ address ++ address

View File

@ -1,5 +1,5 @@
/- *btc
|% |%
+$ network ?(%main %testnet)
++ hash-160 ++ hash-160
|= pubkey=@ux |= pubkey=@ux
^- @ux ^- @ux
@ -154,5 +154,6 @@
%+ encode-raw u.prefix %+ encode-raw u.prefix
(weld ~[0] (convert:bits 8 5 (hash-160 pubkey))) (weld ~[0] (convert:bits 8 5 (hash-160 pubkey)))
-- --
:: ::
-- --

View File

@ -1,14 +1,15 @@
/- *btc
|% |%
+$ address ?(@uc [%bech32 @t])
+$ tx @ +$ tx @
+$ credentials [rpc-url=@t rpc-user=@t rpc-password=@t] +$ credentials [rpc-url=@t rpc-user=@t rpc-password=@t]
+$ bio $: mode=?(%remote %local) +$ status
=credentials :: for connecting to btc-provider $: [%host connected=? clients=(set ship)]
clients=(set ship) :: allowed clients for this node [%client connected=? host=ship]
== ==
+$ action +$ action
$% [%connect =credentials] $% [%connect-as-host =credentials]
[%status ~] [%connect-as-client host=ship]
[%check-status ~]
[%balance =address] [%balance =address]
[%transactions =address] [%transactions =address]
[%broadcast-tx =tx] [%broadcast-tx =tx]

5
sur/btc.hoon Normal file
View File

@ -0,0 +1,5 @@
|%
+$ network ?(%main %testnet)
+$ bech32-address $%([%bech32 tape])
+$ address ?(@uc bech32-address)
--