mirror of
https://github.com/urbit/shrub.git
synced 2024-12-22 10:21:31 +03:00
refactor types into sur; initial types
This commit is contained in:
parent
350c004411
commit
a066d6f337
@ -43,7 +43,7 @@
|
||||
?+ q.vase (on-poke:def mark vase)
|
||||
%status
|
||||
:_ 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 ~])]]
|
||||
==
|
||||
==
|
||||
::
|
||||
|
@ -1,10 +1,9 @@
|
||||
:: btc-scratch.hoon
|
||||
/- *btc
|
||||
/+ bip32, btc
|
||||
=+ ecc=secp256k1:secp:crypto
|
||||
=, bech32:btc
|
||||
|%
|
||||
+$ bech32-address $%([%bech32 tape])
|
||||
+$ address ?(@uc bech32-address)
|
||||
++ bip84
|
||||
|_ [network=network:btc xpub=tape]
|
||||
++ address
|
||||
|
@ -1,5 +1,5 @@
|
||||
/- *btc
|
||||
|%
|
||||
+$ network ?(%main %testnet)
|
||||
++ hash-160
|
||||
|= pubkey=@ux
|
||||
^- @ux
|
||||
@ -154,5 +154,6 @@
|
||||
%+ encode-raw u.prefix
|
||||
(weld ~[0] (convert:bits 8 5 (hash-160 pubkey)))
|
||||
--
|
||||
|
||||
::
|
||||
--
|
||||
|
@ -1,14 +1,15 @@
|
||||
/- *btc
|
||||
|%
|
||||
+$ address ?(@uc [%bech32 @t])
|
||||
+$ tx @
|
||||
+$ credentials [rpc-url=@t rpc-user=@t rpc-password=@t]
|
||||
+$ bio $: mode=?(%remote %local)
|
||||
=credentials :: for connecting to btc-provider
|
||||
clients=(set ship) :: allowed clients for this node
|
||||
+$ status
|
||||
$: [%host connected=? clients=(set ship)]
|
||||
[%client connected=? host=ship]
|
||||
==
|
||||
+$ action
|
||||
$% [%connect =credentials]
|
||||
[%status ~]
|
||||
$% [%connect-as-host =credentials]
|
||||
[%connect-as-client host=ship]
|
||||
[%check-status ~]
|
||||
[%balance =address]
|
||||
[%transactions =address]
|
||||
[%broadcast-tx =tx]
|
||||
|
5
sur/btc.hoon
Normal file
5
sur/btc.hoon
Normal file
@ -0,0 +1,5 @@
|
||||
|%
|
||||
+$ network ?(%main %testnet)
|
||||
+$ bech32-address $%([%bech32 tape])
|
||||
+$ address ?(@uc bech32-address)
|
||||
--
|
Loading…
Reference in New Issue
Block a user