mirror of
https://github.com/urbit/shrub.git
synced 2024-12-16 06:51:14 +03:00
c9539452e2
Conflicts: urb/urbit.pill urb/zod/base/mar/bit-accounts.hoon urb/zod/base/mar/bit-addr-made.hoon urb/zod/base/mar/bit-addr-request.hoon urb/zod/base/mar/bit-api-call.hoon urb/zod/base/mar/bit-get-token.hoon urb/zod/base/mar/bit-transaction.hoon urb/zod/base/mar/bit/accounts.hoon urb/zod/base/mar/bit/addr-made.hoon urb/zod/base/mar/bit/addr-request.hoon urb/zod/base/mar/bit/api-call.hoon urb/zod/base/mar/bit/get-token.hoon urb/zod/base/mar/bit/transaction.hoon urb/zod/base/mar/cloud-auth.hoon urb/zod/base/mar/cloud-secret.hoon urb/zod/base/mar/cloud/auth.hoon urb/zod/base/mar/cloud/secret.hoon urb/zod/base/mar/dill-belt.hoon urb/zod/base/mar/dill-blit.hoon urb/zod/base/mar/dill/belt.hoon urb/zod/base/mar/dill/blit.hoon urb/zod/base/mar/oct3-move.hoon urb/zod/base/mar/oct3-update.hoon urb/zod/base/mar/oct3/move.hoon urb/zod/base/mar/oct3/update.hoon urb/zod/base/mar/oct4-move.hoon urb/zod/base/mar/oct4-update.hoon urb/zod/base/mar/oct4/move.hoon urb/zod/base/mar/oct4/update.hoon urb/zod/base/mar/sole-action.hoon urb/zod/base/mar/sole-effect.hoon urb/zod/base/mar/sole/action.hoon urb/zod/base/mar/sole/effect.hoon urb/zod/base/mar/talk-command.hoon urb/zod/base/mar/talk-report.hoon urb/zod/base/mar/talk/command.hoon urb/zod/base/mar/talk/report.hoon urb/zod/mar/bit-accounts.hoon urb/zod/mar/bit-addr-made.hoon urb/zod/mar/bit-addr-request.hoon urb/zod/mar/bit-api-call.hoon urb/zod/mar/bit-get-token.hoon urb/zod/mar/bit-transaction.hoon urb/zod/mar/cloud-auth.hoon urb/zod/mar/cloud-auth/door.hook urb/zod/mar/cloud-secret.hoon urb/zod/mar/cloud-secret/door.hook urb/zod/mar/dill-belt.hoon urb/zod/mar/dill-blit.hoon urb/zod/mar/oct3-move.hoon urb/zod/mar/oct3-update.hoon urb/zod/mar/oct4-move.hoon urb/zod/mar/oct4-update.hoon urb/zod/mar/sole-action.hoon urb/zod/mar/sole-effect.hoon urb/zod/mar/talk-command.hoon urb/zod/mar/talk-report.hoon
31 lines
753 B
Plaintext
31 lines
753 B
Plaintext
::
|
|
:::: /hoon/bit-api-call/mar
|
|
::
|
|
/? 314
|
|
/- *bit-api
|
|
|_ [access-token=@t req=bit-api-call]
|
|
::
|
|
++ wrap
|
|
|= [end-point=path req=$|(%get [%post p=json])]
|
|
[/com/coinbase/sandbox/api v1/end-point req ~ ['access_token' access-token]~]
|
|
::
|
|
++ order
|
|
|= [amount=@t currency=@t] ^- json
|
|
(jobe qty/s/amount ?~(currency ~ [currency/s/currency ~]))
|
|
++ grow
|
|
|% ++ httpreq
|
|
%- wrap
|
|
|-
|
|
?- -.req
|
|
%list [/accounts %get]
|
|
%buy [/buys %post (order +.req)]
|
|
%sell [/sells %post (order +.req)]
|
|
%send $(req [%txt-send (rsh 3 2 (scot %uc adr.req)) btc.req])
|
|
%txt-send
|
|
:+ /transactions/'send_money' %post
|
|
(joba %transaction (jobe to/s/to.req amount/s/btc.req ~))
|
|
|
|
==
|
|
--
|
|
--
|