ported to real network

This commit is contained in:
Henry Ault 2015-05-07 02:49:30 -04:00
parent 4b928f5e22
commit 478d210298
7 changed files with 89 additions and 28 deletions

View File

@ -13,9 +13,9 @@
++ cred
$: client-id=(unit ,@t) app-secret=(unit ,@t)
oauth-code=(unit ,@t) auth-token=(unit ,@t)
refr-token=(unit ,@t) contacts=(map ,@t ,@t)
refr-token=(unit ,@t) cont-to-adr=(map ,@t ,@t)
==
++ move (mold note gift)
::++ move (mold note gift)
++ sign
$% $: %e
$% [%thou p=httr]
@ -25,7 +25,7 @@ $: client-id=(unit ,@t) app-secret=(unit ,@t)
--
!:
|%
++ auth-url "https://sandbox.coinbase.com/oauth/authorize?".
++ auth-url "https://www.coinbase.com/oauth/authorize?".
"response_type=code".
"&client_id=c911e4cb6d0b2ce4da92a75ae5acefe61a9b494332dd37844043ce820030d088".
"&redirect_uri={(urle "http://localhost:8443/home/pub/bit/fab")}".
@ -44,10 +44,12 @@ $: client-id=(unit ,@t) app-secret=(unit ,@t)
==
=+ prl=`purl`(need (epur (crip auth-url)))
:_ +>.$
:^ %- publish
:+ %- publish
:^ ost you %court
[%lin & 'secret and client id saved successfully']
(publish ost you %court [%url prl])
:~ [%lin & 'secret and client id saved successfully']
[%lin & 'please click on the url below to continue authentication']
[%url prl]
==
[ost %give %nice ~]
~
::
@ -66,7 +68,7 @@ $: client-id=(unit ,@t) app-secret=(unit ,@t)
==
:_ +>.$
:+ [ost %give %nice ~]
(httpreq ost /auth-token /com/coinbase/sandbox /oauth/token [%post ~] ~ queries)
(httpreq ost /auth-token /com/coinbase /oauth/token [%post ~] ~ queries)
~
++ poke-buy
|= [ost=bone you=ship arg=[amount=@t currency=@t]]
@ -79,22 +81,22 @@ $: client-id=(unit ,@t) app-secret=(unit ,@t)
(jobe qty/s/amount.arg currency/s/currency.arg ~)
:_ +>.$
:+ [ost %give %nice ~]
(httpreq ost /buy /com/coinbase/sandbox/api /v1/buys [%post pst] ~ query)
(httpreq ost /buy /com/coinbase/api /v1/buys [%post pst] ~ query)
~
::
++ poke-bit-contact
++ poke-contact
|= [ost=bone you=ship arg=[name=@t address=@t]]
=. contacts.vat (~(put by contacts.vat) arg)
~& saved/contacts.vat
:_ +>.$
[ost %give %nice ~]~
::
++ poke-bit-list
++ poke-list
|= [ost=bone you=ship arg=~]
=+ query=['access_token' (need auth-token.vat)]~
:_ +>.$
:+ [ost %give %nice ~]
(httpreq ost /list /com/coinbase/sandbox/api /v1/accounts %get ~ query)
(httpreq ost /list /com/coinbase/api /v1/accounts %get ~ query)
~
::
++ poke-sell
@ -108,10 +110,10 @@ $: client-id=(unit ,@t) app-secret=(unit ,@t)
(jobe qty/s/amount.arg ~)
:_ +>.$
:+ [ost %give %nice ~]~
(httpreq ost /buy /com/coinbase/sandbox/api /v1/sells [%post pst] ~ query)
(httpreq ost /buy /com/coinbase/api /v1/sells [%post pst] ~ query)
~
::
++ poke-bit-send
++ poke-send
|= $: ost=bone you=ship
arg=[to=@t amone=(unit ,@t) cur=(unit ,@t) amtwo=(unit ,@t) nt=(unit ,@t)]
==
@ -127,8 +129,21 @@ $: client-id=(unit ,@t) app-secret=(unit ,@t)
(jobe transaction/(jobe info) ~)
:_ +>.$
:+ [ost %give %nice ~]
(httpreq ost /send /com/coinbase/sandbox/api /v1/transactions/'send_money' [%post pst] ~ query)
(httpreq ost /send /com/coinbase/api /v1/transactions/'send_money' [%post pst] ~ query)
~
::
++ poke-json
|= [ost=bone you=ship arg=json]
~& arg
=+ queries=['access_token' (need auth-token.vat)]~
=+ transaction-id='554b029661a032acbb000024' :: XX pars
:_ +>.$
:_ [ost %give %nice ~]~
%- httpreq
:* ost /get-id /com/coinbase/api
/v1/transactions/[transaction-id] %get
~ queries
==
++ pour
|= [ost=bone pax=path res=sign]
?+ -.pax !!
@ -147,6 +162,10 @@ $: client-id=(unit ,@t) app-secret=(unit ,@t)
%auth
:_ +>.$
[ost %give %nice ~]~
%get-id
~& get-id/res
:_ +>.$
[ost %give %nice ~]~
%send
~& res
:_ +>.$
@ -166,17 +185,21 @@ $: client-id=(unit ,@t) app-secret=(unit ,@t)
==
::
++ publish
|= [ost=bone you=ship dest=?(%porch %court) act=speech]
=+ ^- thot=thought
:+ *serial
^- audience
:+ :- `partner`[%& our.hid %court]
^- (pair envelope delivery)
[`envelope`[& ~] %pending]
|= [ost=bone you=ship dest=?(%porch %court) act=(list speech)]
=+ ^= spchz
%+ turn act
|= sp=speech
=+ ^= tail
:- ^- audience
:+ :- `partner`[%& our.hid %court]
^- (pair envelope delivery)
[`envelope`[& ~] %pending]
~
~
~
`statement`[lat.hid ~ act]
=. p.thot `@`(sham eny.hid +.thot)
=+ cag=`cage`[%talk-command !>([%publish `(list thought)`[thot ~]])]
`statement`[lat.hid ~ sp]
^- thought
:- `@`(sham eny.hid tail)
tail
=+ cag=`cage`[%talk-command !>([%publish `(list thought)`spchz])]
[ost %pass /auth %g %mess [our.hid /talk] you cag]
--

View File

@ -0,0 +1,13 @@
::
::::
::
/? 310
::
:::::::
!:
|= [^ arg=[address=@t contact=@t ~] ~]
:- %address-contact
[address.arg contact.arg]

View File

@ -0,0 +1,13 @@
::
::::
::
/? 310
::
:::::::
!:
|= [^ arg=[contact=@t address=@t ~] ~]
:- %bit-contact
[contact.arg address.arg]

View File

@ -6,6 +6,6 @@
:::::::
!:
|= [^ ~ ~]
:- %bit-list
:- %list
~

View File

@ -6,6 +6,6 @@
:::::::
!:
|= [^ [amount=@t currency=@t ~] ~]
:- %buy
:- %sell
[amount currency]

View File

@ -0,0 +1,12 @@
::
::::
::
/? 310
::
:::::::
!:
|= [^ arg=[to=@t amount=(unit ,@t) currency=(unit ,@t) astring=(unit ,@t) notes=(unit ,@t) ~] ~]
:- %send
[to.arg amount.arg currency.arg astring.arg notes.arg]

View File

@ -13,7 +13,7 @@
;html
;head
;title: Coinbase Auth
;script@"/~/at/main/lib/urb.js";
;script@"/~/at/home/lib/urb.js";
==
;body
;*