Moved from to bowl.

This commit is contained in:
C. Guy Yarvin 2015-05-27 23:51:32 -07:00
parent ec1bb36984
commit 7ec596e1b5
11 changed files with 112 additions and 119 deletions

View File

@ -65,7 +65,7 @@ $: client-id=(unit ,@t) app-secret=(unit ,@t)
::
++ callback-uri (weld hostname "/~/to/{(trip app.hid)}/json.json?anon&wire=/")
++ poke-auth
|= [[ost=bone you=ship] arg=[secr=cord id=cord]]
|= [arg=[secr=cord id=cord]]
=: app-secret.vat [~ secr.arg]
client-id.vat [~ id.arg]
==
@ -84,7 +84,7 @@ $: client-id=(unit ,@t) app-secret=(unit ,@t)
[ost %send way [his app.hid] %poke mez]
::
++ poke-bit-send :: send to address
|= [[ost=bone @] addr=@uc amount=@t]
|= [addr=@uc amount=@t]
:_ +>.$
:_ ~
=+ info=[to/s/(rsh 3 2 (scot %uc addr)) amount/s/amount ~]
@ -92,13 +92,13 @@ $: client-id=(unit ,@t) app-secret=(unit ,@t)
(api-call ost /send /transactions/'send_money' %post jon)
::
++ poke-bit-ship-send :: send to ship
|= [[ost=bone @] to=ship amount=@t]
|= [to=ship amount=@t]
=. outgoing.vat (~(put by outgoing.vat) to amount)
:_ +>.$
:_ ~
(send-friend ost /sent to %bit-addr-request ~)
++ poke-bit-addr-request :: give your address to receive bit
|= [[ost=bone his=ship] req=~] :: gen new address with callback
|= [req=~] :: gen new address with callback
:_ +>.$
:_ ~
%^ api-call ost /addr-request/(scot %p his)
@ -121,7 +121,7 @@ $: client-id=(unit ,@t) app-secret=(unit ,@t)
(send-friend ost [%message ~] his %bit-addr-made adr)
::
++ poke-bit-addr-made :: receive address for sending
|= [[ost=bone his=ship] addr=@t]
|= [addr=@t]
:_ +>.$
:_ ~
=+ amount=(~(got by outgoing.vat) his) :: get amount to send
@ -130,7 +130,7 @@ $: client-id=(unit ,@t) app-secret=(unit ,@t)
(api-call ost /send /transactions/'send_money' %post jon)
::
++ poke-oauth2-code
|= [[ost=bone you=ship] code=cord]
|= [code=cord]
=. oauth-code.vat
[~ code]
?< |(?=(~ client-id.vat) ?=(~ oauth-code.vat))
@ -145,7 +145,7 @@ $: client-id=(unit ,@t) app-secret=(unit ,@t)
:- (httpreq ost /auth-token /com/coinbase /oauth/token [%post ~] ~ queries)
~
++ poke-buy
|= [[ost=bone you=ship] arg=[amount=@t currency=@t]]
|= [arg=[amount=@t currency=@t]]
?< =(~ amount.arg)
=+ query=['access_token' (need auth-token.vat)]~
=+ ^= pst
@ -157,14 +157,14 @@ $: client-id=(unit ,@t) app-secret=(unit ,@t)
~
::
++ poke-list
|= [[ost=bone you=ship] arg=~]
|= [arg=~]
=+ query=['access_token' (need auth-token.vat)]~
:_ +>.$
:- (httpreq ost /list /com/coinbase/api /v1/accounts %get ~ query)
~
::
++ poke-sell
|= [[ost=bone you=ship] arg=[amount=@t currency=@t]]
|= [arg=[amount=@t currency=@t]]
?< =(amount.arg ~)
=+ query=['access_token' (need auth-token.vat)]~
=+ ^= pst
@ -177,9 +177,7 @@ $: client-id=(unit ,@t) app-secret=(unit ,@t)
~
::
++ poke-send-raw
|= $: [ost=bone you=ship]
arg=[to=@t amone=(unit ,@t) cur=(unit ,@t) amtwo=(unit ,@t) nt=(unit ,@t)]
==
|= arg=[to=@t amone=(unit ,@t) cur=(unit ,@t) amtwo=(unit ,@t) nt=(unit ,@t)]
=+ adr=?~((~(get by contacts.vat) to.arg) to ~&('contact-exists' (~(get by contacts.vat) to.arg)))
=+ query=['access_token' (need auth-token.vat)]~
=+ ^= info
@ -195,7 +193,7 @@ $: client-id=(unit ,@t) app-secret=(unit ,@t)
~
::
++ poke-json
|= [[ost=bone you=ship] arg=json]
|= [arg=json]
~& arg
:_ +>.$
=+ [adr amo]=(need %.(arg (ot address/so amount/no ~):jo))
@ -211,7 +209,7 @@ $: client-id=(unit ,@t) app-secret=(unit ,@t)
!!
::
++ thou
|= [[ost=bone @ way=wire] res=httr]
|= [way=wire res=httr]
?+ -.way !!
%auth-token
~| 'must receive a 200'^oauth-code.vat

View File

@ -138,7 +138,7 @@ $% [%thou p=httr]
==
--
!:
|_ [hid=bowl vat=axle]
|_ [hid=hide vat=axle]
::
++ auth-queries
:~ 'grant_type'^'authorization_code'

View File

@ -715,15 +715,15 @@
--
::
++ peer-sole
|= [from pax=path]
|= [pax=path]
^- (quip move +>)
~? !=(src our.hid) [%dojo-peer-stranger ost src pax]
:: ?> =(src our.hid)
?< (~(has by hoc) ost)
~? !=(src.hid our.hid) [%dojo-peer-stranger ost.hid src.hid pax]
:: ?> =(src.hid our.hid)
?< (~(has by hoc) ost.hid)
?> =(~ pax)
=< he-abet
%~ he-peer he
:- [ost ~]
:- [ost.hid ~]
^- session
:* *sole-share :: say=sole-share
%home :: syd=desk
@ -734,24 +734,24 @@
==
::
++ poke-sole-action
|= [from act=sole-action]
|= [act=sole-action]
^- (quip move +>)
:: ~& [%dojo-poke ost src act]
:: ~? !=(src our.hid) [%dojo-poke ost src]
he-abet:(~(he-type he [ost ~] (~(got by hoc) ost)) act)
:: ~& [%dojo-poke ost.hid src.hid act]
:: ~? !=(src.hid our.hid) [%dojo-poke ost.hid src.hid]
he-abet:(~(he-type he [ost.hid ~] (~(got by hoc) ost.hid)) act)
::
++ made
|= [then dep=@uvH reg=(each gage tang)]
he-abet:(~(he-made he [[ost ~] (~(got by hoc) ost)]) way dep reg)
he-abet:(~(he-made he [[ost.hid ~] (~(got by hoc) ost.hid)]) way dep reg)
::
++ unto
|= [then cit=cuft]
he-abet:(~(he-unto he [[ost ~] (~(got by hoc) ost)]) cit)
he-abet:(~(he-unto he [[ost.hid ~] (~(got by hoc) ost.hid)]) cit)
::
++ pull
|= [from pax=path]
|= [pax=path]
^- (quip move +>)
=^ moz +>
he-abet:~(he-stop he [[ost ~] (~(got by hoc) ost)])
[moz +>.$(hoc (~(del by hoc) ost))]
he-abet:~(he-stop he [[ost.hid ~] (~(got by hoc) ost.hid)])
[moz +>.$(hoc (~(del by hoc) ost.hid))]
--

View File

@ -51,7 +51,7 @@
:: :: ::
++ coup-kiln-fancy ::
|= [then saw=(unit tang)]
(ably (take-coup-fancy:(kiln-work [hid ost src] (able %kiln)) way +<+))
(ably (take-coup-fancy:(kiln-work hid (able %kiln)) way +<+))
::
++ coup-kiln-spam ::
|= [then saw=(unit tang)]
@ -60,67 +60,67 @@
::
++ coup-drum ::
|= [then saw=(unit tang)]
(ably (take-coup:(drum-work [hid ost src] (able %drum)) way +<+))
(ably (take-coup:(drum-work hid (able %drum)) way +<+))
::
++ diff-sole-effect-drum
|= [then sole-effect]
(ably (diff-sole-effect:(drum-work [hid ost src] (able %drum)) way +<+))
(ably (diff-sole-effect:(drum-work hid (able %drum)) way +<+))
::
++ poke-hood-begin ::
|= [from hood-begin]
(ably (poke-begin:(helm-work [hid +<-] (able %helm)) +<+))
|= hood-begin
(ably (poke-begin:(helm-work hid (able %helm)) +<))
::
++ poke-helm-init ::
|= [from hood-init]
(ably (poke-init:(helm-work [hid +<-] (able %helm)) +<+))
|= hood-init
(ably (poke-init:(helm-work hid (able %helm)) +<))
::
++ poke-hood-mass ::
|= [from ~]
(ably poke-mass:(helm-work [hid +<-] (able %helm)))
|= ~
(ably poke-mass:(helm-work hid (able %helm)))
::
++ poke-hood-merge ::
|= [from hood-merge]
(ably (poke-merge:(kiln-work [hid +<-] (able %kiln)) +<+))
|= hood-merge
(ably (poke-merge:(kiln-work hid (able %kiln)) +<))
::
++ poke-hood-reload ::
|= [from hood-reload]
(ably (poke-reload:(helm-work [hid +<-] (able %helm)) +<+))
|= hood-reload
(ably (poke-reload:(helm-work hid (able %helm)) +<))
::
++ poke-hood-reset ::
|= [from ~]
(ably (poke-reset:(helm-work [hid +<-] (able %helm)) +<+))
|= ~
(ably (poke-reset:(helm-work hid (able %helm)) +<))
::
++ poke-hood-sync ::
|= [from hood-sync]
(ably (poke-sync:(kiln-work [hid +<-] (able %kiln)) +<+))
|= hood-sync
(ably (poke-sync:(kiln-work hid (able %kiln)) +<))
::
++ poke-hood-unix ::
|= [from hood-unix]
(ably (poke-unix:(kiln-work [hid +<-] (able %kiln)) +<+))
|= hood-unix
(ably (poke-unix:(kiln-work hid (able %kiln)) +<))
::
++ poke-hood-verb ::
|= [from ~]
(ably (poke-verb:(helm-work [hid +<-] (able %helm)) +<+))
|= ~
(ably (poke-verb:(helm-work hid (able %helm)) +<))
::
++ poke-hood-start ::
|= [from drum-start]
(ably (poke-start:(drum-work [hid +<-] (able %drum)) +<+))
|= drum-start
(ably (poke-start:(drum-work hid (able %drum)) +<))
::
++ poke-dill-belt
|= [from dill-belt]
(ably (poke-dill-belt:(drum-work [hid +<-] (able %drum)) +<+))
|= dill-belt
(ably (poke-dill-belt:(drum-work hid (able %drum)) +<))
::
++ poke-will ::
|= [from (unit will)]
(ably (poke-will:(helm-work [hid +<-] (able %helm)) +<+))
|= (unit will)
(ably (poke-will:(helm-work hid (able %helm)) +<))
::
++ mere-kiln ::
|= [then are=(each (set path) (pair term tang))]
(ably (take-mere:(kiln-work [hid ost src] (able %kiln)) way +<+))
(ably (take-mere:(kiln-work hid (able %kiln)) way +<+))
::
++ made-kiln ::
|= [then @uvH (each gage tang)]
(ably (take-made:(kiln-work [hid ost src] (able %kiln)) way +<+))
(ably (take-made:(kiln-work hid (able %kiln)) way +<+))
::
++ init-helm ::
|= [then *]
@ -128,25 +128,25 @@
::
++ note-helm ::
|= [then (pair ,@tD tank)]
(ably (take-note:(helm-work [hid ost src] (able %helm)) way +<+))
(ably (take-note:(helm-work hid (able %helm)) way +<+))
::
++ reap-drum
|= [then saw=(unit tang)]
(ably (reap:(drum-work [hid ost src] (able %drum)) way +<+))
(ably (reap:(drum-work hid (able %drum)) way +<+))
::
++ onto-drum ::
|= [then saw=(each ,[term @tas @da] tang)]
(ably (take-onto:(drum-work [hid ost src] (able %drum)) way +<+))
(ably (take-onto:(drum-work hid (able %drum)) way +<+))
::
++ peer-drum
|= [from pax=path]
(ably (peer:(drum-work [hid +<-] (able %drum)) +<+))
|= pax=path
(ably (peer:(drum-work hid (able %drum)) +<))
::
++ quit-drum
|= then
(ably (quit:(drum-work [hid ost src] (able %drum)) way))
(ably (quit:(drum-work hid (able %drum)) way))
::
++ went-helm ::
|= [then her=ship kay=cape]
(ably (take-went:(helm-work [hid ost src] (able %helm)) way +<+))
(ably (take-went:(helm-work hid (able %helm)) way +<+))
--

View File

@ -35,7 +35,7 @@
-- ::
|_ [hid=bowl moz=(list move) %1 axle] :: per agent
++ ce :: per client
|_ from ::
|_ [ost=bone src=ship] ::
:: :: ::
:::: :: :: common logic
:: :: ::
@ -183,25 +183,25 @@
|= [then mex=(each game tape)] ::
abet:(~(diff-octo-update ce ost src) way mex) ::
++ peer-octo :: urbit peer
|= [from path] ::
abet:(~(peer-octo ce +<-) +<+) ::
|= path ::
abet:(~(peer-octo ce ost src) +<) ::
++ peer-sole :: console subscribe
|= [from path] ::
abet:(~(peer-sole ce +<-) +<+) ::
|= path ::
abet:(~(peer-sole ce ost src) +<) ::
++ poke-sole-action :: console input
|= [from sole-action] ::
abet:(~(poke-sole-action ce +<-) +<+) ::
|= sole-action ::
abet:(~(poke-sole-action ce ost src) +<) ::
++ poke-octo-move ::
|= [from point] ::
abet:(~(poke-octo-move ce +<-) +<+) ::
++ prep |= [from (unit ,[(list move) axon])] :: initialize
abet:(~(prep ce +<-) +<+) ::
|= point ::
abet:(~(poke-octo-move ce ost src) +<) ::
++ prep |= (unit ,[(list move) axon]) :: initialize
abet:(~(prep ce ost src) +<) ::
++ pull-octo :: unsubscribe
|= [from path] ::
abet:(~(pull-octo ce +<-) +<+) ::
|= path ::
abet:(~(pull-octo ce ost src) +<) ::
++ pull-sole :: disconnect console
|= [from path] ::
abet:(~(pull-sole ce +<-) +<+) ::
|= path ::
abet:(~(pull-sole ce ost src) +<) ::
++ quit-octo :: unlinked by friend
|= then ::
abet:(~(quit-octo ce ost src) way) ::

View File

@ -1658,35 +1658,35 @@
--
::
++ peer :: accept subscription
|= [from pax=path]
|= [pax=path]
^- [(list move) _+>]
:: ~& [%talk-peer src ost pax]
:: ~& [%talk-peer src.hid ost.hid pax]
?: ?=([%sole *] pax)
?> =(our.hid src)
?< (~(has by shells) ost)
ra-abet:(~(ra-console ra ost ~) src t.pax)
:: ~& [%talk-peer-data ost src pax]
ra-abet:(~(ra-subscribe ra ost ~) src pax)
?> =(our.hid src.hid)
?< (~(has by shells) ost.hid)
ra-abet:(~(ra-console ra ost.hid ~) src.hid t.pax)
:: ~& [%talk-peer-data ost.hid src.hid pax]
ra-abet:(~(ra-subscribe ra ost.hid ~) src.hid pax)
::
++ poke-talk-command :: accept command
|= [from cod=command]
|= [cod=command]
^- [(list move) _+>]
:: ~& [%talk-poke-command src cod]
ra-abet:(~(ra-apply ra ost ~) src cod)
:: ~& [%talk-poke-command src.hid cod]
ra-abet:(~(ra-apply ra ost.hid ~) src.hid cod)
::
++ poke-sole-action :: accept console
|= [from act=sole-action]
ra-abet:(~(ra-sole ra ost ~) act)
|= [act=sole-action]
ra-abet:(~(ra-sole ra ost.hid ~) act)
::
++ diff-talk-report ::
|= [then rad=report]
%+ etch-friend way |= [man=span cuz=station]
ra-abet:(~(ra-diff-talk-report ra ost ~) man cuz rad)
ra-abet:(~(ra-diff-talk-report ra ost.hid ~) man cuz rad)
::
++ coup-repeat ::
|= [then saw=(unit tang)]
%+ etch-repeat [%repeat way] |= [num=@ud src=@p man=span]
ra-abet:(~(ra-coup-repeat ra ost ~) [num src man] saw)
ra-abet:(~(ra-coup-repeat ra ost.hid ~) [num src man] saw)
::
++ etch :: parse wire
|= way=wire
@ -1717,29 +1717,29 @@
?~ saw [~ +>]
%+ etch-friend [%friend way] |= [man=span cuz=station]
~& [%reap-friend-fail man cuz u.saw]
ra-abet:(~(ra-quit ra ost ~) man cuz)
ra-abet:(~(ra-quit ra ost.hid ~) man cuz)
::
++ quit-friend ::
|= then
%+ etch-friend [%friend way] |= [man=span cuz=station]
ra-abet:(~(ra-retry ra ost ~) man cuz)
ra-abet:(~(ra-retry ra ost.hid ~) man cuz)
::
++ pull ::
|= [from pax=path]
|= [pax=path]
^- [(list move) _+>]
~& [%talk-pull src ost pax]
=^ moz +>.$ ra-abet:(~(ra-cancel ra ost ~) src pax)
[moz +>.$(shells (~(del by shells) ost))]
~& [%talk-pull src.hid ost.hid pax]
=^ moz +>.$ ra-abet:(~(ra-cancel ra ost.hid ~) src.hid pax)
[moz +>.$(shells (~(del by shells) ost.hid))]
::
::++ poke-bit
:: |= [from ~]
:: |= [~]
:: ^- (quip move +>)
:: :_ +>.$
:: =+ paf=/(scot %p our.hid)/try/(scot %da now.hid)/talk/backlog/jam
:: [ost %info /jamfile our.hid (foal paf (jam +<+.+>.$))]~
:: [ost.hid %info /jamfile our.hid (foal paf (jam +<+.+>.$))]~
::
++ prep
|= [from old=(unit house)]
|= [old=(unit house)]
^- (quip move +>)
?~ old
ra-abet:~(ra-init ra 0 ~)

View File

@ -546,8 +546,8 @@
=+ ^= arg ^- vase
%- slop
?: =(0 p.u.cug)
[!>([`@ud`ost `@p`q.q.pry `path`+.pax]) !>(cag)]
[!>([`@ud`ost `@p`q.q.pry (slag (dec p.u.cug) `path`+.pax)]) q.cag]
[!>(`path`+.pax) !>(cag)]
[!>((slag (dec p.u.cug) `path`+.pax)) q.cag]
=^ cam +>.$ (ap-call q.u.cug arg)
?^ cam
(ap-pump:(ap-lame q.u.cug u.cam) | her pax)
@ -782,7 +782,7 @@
=. zip ~
=^ cam +>.$
%+ ap-call q.u.cug
!>([[`@ud`ost `@p`q.q.pry] `path`(slag p.u.cug pax)])
!>(`path`(slag p.u.cug pax))
=. zip (weld zip `(list cove)`[[ost %give %reap cam] old])
?^(cam ap-pule +>.$)
::
@ -802,8 +802,6 @@
:: ~& [%ap-poke dap p.cag cug]
=^ tur +>.$
%+ ap-call q.u.cug
%+ slop
!>([`@ud`ost `@p`q.q.pry])
?. =(0 p.u.cug) q.cag
(slop (ap-term %tas p.cag) q.cag)
(ap-give %coup tur)
@ -817,7 +815,7 @@
+>.$
=^ cam +>.$
%+ ap-call q.u.cug
!>([[`@ud`ost `@p`q.q.pry] wut why])
!>([wut why])
?^ cam
~&([%ap-lame-lame u.cam] +>.$)
+>.$
@ -833,7 +831,7 @@
=^ cam +>.$
%+ ap-call q.u.cug
%+ slop
!>([`@ud`ost `@p`q.q.pry `path`(slag p.u.cug pax)])
!>(`path`(slag p.u.cug pax))
(slot 3 vax)
?^ cam (ap-lame -.q.vax u.cam)
+>.$
@ -869,8 +867,6 @@
`+>.$(+13.q.hav +13.q.u.vux)
=^ tur +>.$
%+ ap-call %prep
%+ slop
!>([`@ud`ost `@p`q.q.pry])
?~(vux !>(~) (slop !>(~) (slot 13 u.vux)))
?~(tur `+>.$ :_(+>.$ `u.tur))
::
@ -894,7 +890,7 @@
?~ cug +>
=^ cam +>
%+ ap-call q.u.cug
!>([[`@ud`ost `@p`q.q.pry] (slag p.u.cug q.u.wim)])
!>((slag p.u.cug q.u.wim))
?^ cam (ap-lame q.u.cug u.cam)
+>+
::
@ -911,7 +907,7 @@
+>.$
=^ cam +>.$
%+ ap-call q.u.cug
=+ den=!>([`@ud`ost `@p`q.q.pry (slag p.u.cug pax)])
=+ den=!>((slag p.u.cug pax))
?~(vux den (slop den u.vux))
?^ cam (ap-lame q.u.cug u.cam)
+>.$

View File

@ -9619,7 +9619,6 @@
++ curd ,[p=@tas q=*] :: typeless card
++ duct (list wire) :: causal history
++ gage (pair marc vase) :: structured cage
++ from ,[ost=bone src=ship] :: forward problem
++ hypo |*(a=$+(* *) (pair type a)) :: type associated
++ hobo |* a=$+(* *) :: kiss wrapper
$? $% [%soft p=*] ::
@ -9664,7 +9663,7 @@
++ slad $+ [(unit (set monk)) term beam] :: undertyped
(unit (unit (cask))) ::
++ slut $+(* (unit (unit))) :: old namespace
++ then ,[ost=bone src=ship way=wire] :: backward problem
++ then ,[way=wire] :: backward problem
++ vile :: reflexive constants
$: typ=type :: -:!>(*type)
duc=type :: -:!>(*duct)

View File

@ -122,7 +122,7 @@
?>(?=([@ @ ~] way) [(slav %p i.way) i.t.way])
::
++ drum-work :: work in drum
|= [[bowl from] drum-part]
|= [bowl drum-part]
=+ (fall (~(get by bin) ost) (deft-pipe our))
=> |% :: arvo structures
++ pear :: request

View File

@ -43,7 +43,7 @@
!: :: ::
|% :: helm library
++ helm-work :: work in helm
|= [[bowl from] helm-part]
|= [bowl helm-part]
=+ sez=(fall (~(get by hoc) ost) *helm-session)
=> |% :: arvo structures
++ card ::

View File

@ -41,7 +41,7 @@
!: :: ::
|% :: kiln library
++ kiln-work :: work in kiln
|= [[bowl from] kiln-part]
|= [bowl kiln-part]
?> =(src our)
=> |% :: arvo structures
++ card ::