mirror of
https://github.com/ilyakooo0/urbit.git
synced 2024-12-15 01:52:42 +03:00
59 lines
1.1 KiB
Plaintext
59 lines
1.1 KiB
Plaintext
|
:: bippy-provider.hoon
|
||
|
:: Provider for accessing BTC full node
|
||
|
::
|
||
|
/+ dbug, default-agent
|
||
|
|%
|
||
|
+$ versioned-state
|
||
|
$% state-0
|
||
|
==
|
||
|
::
|
||
|
+$ state-0 [%0 counter=@]
|
||
|
::
|
||
|
+$ card card:agent:gall
|
||
|
::
|
||
|
--
|
||
|
%- agent:dbug
|
||
|
=| state-0
|
||
|
=* state -
|
||
|
^- agent:gall
|
||
|
|_ =bowl:gall
|
||
|
+* this .
|
||
|
def ~(. (default-agent this %|) bowl)
|
||
|
hc ~(. +> bowl)
|
||
|
::
|
||
|
++ on-init
|
||
|
^- (quip card _this)
|
||
|
~& > '%bippy-provider initialized successfully'
|
||
|
`this
|
||
|
++ on-save
|
||
|
^- vase
|
||
|
!>(state)
|
||
|
++ on-load
|
||
|
|= old-state=vase
|
||
|
^- (quip card _this)
|
||
|
~& > '%bippy-provider recompiled successfully'
|
||
|
`this(state !<(versioned-state old-state))
|
||
|
++ on-poke
|
||
|
|= [=mark =vase]
|
||
|
^- (quip card _this)
|
||
|
?+ mark (on-poke:def mark vase)
|
||
|
%noun
|
||
|
?+ q.vase (on-poke:def mark vase)
|
||
|
%send-tx
|
||
|
~& >>> %send-tx
|
||
|
:_ this
|
||
|
~
|
||
|
:: :~ [%pass /[url.action] %arvo %i %request (get-url url.action) *outbound-config:iris]
|
||
|
==
|
||
|
==
|
||
|
==
|
||
|
::
|
||
|
++ on-watch on-watch:def
|
||
|
++ on-leave on-leave:def
|
||
|
++ on-peek on-peek:def
|
||
|
++ on-agent on-agent:def
|
||
|
++ on-arvo on-arvo:def
|
||
|
++ on-fail on-fail:def
|
||
|
--
|
||
|
:: helper core
|