Skip to content

Commit

Permalink
pulic apis
Browse files Browse the repository at this point in the history
  • Loading branch information
yoshihiro503 committed Mar 17, 2024
1 parent 3d4a04c commit 82263d1
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 48 deletions.
7 changes: 6 additions & 1 deletion lib/bitflyer.ml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,15 @@ open Common

let buy auth currency_pair ?(order=Market) amount =
Lwt_main.run begin
BitflyerApi.sendchildorder auth currency_pair order Buy amount
BitflyerApi.me_sendchildorder auth currency_pair order Buy amount
>>= fun json -> Log.debug "buy: %s" (Json.to_string json); Lwt.return ()
end

let get_executions auth currency_pair =
Lwt_main.run begin
BitflyerApi.me_getexecutions auth currency_pair
end

module Datetime = Datetime

module Log = Log
Expand Down
24 changes: 20 additions & 4 deletions lib/bitflyerApi.ml
Original file line number Diff line number Diff line change
@@ -1,9 +1,25 @@
let getticker = Ticker.getticker
let getmarkets = Public.getmarkets
let markets = Public.markets

let getboard = Public.getboard
let board = Public.board

let getticker = Public.getticker
let ticker = Public.ticker

let getexecutions = Public.getexecutions
let executions = Public.executions

let getboardstate = Public.getboardstate

let gethealth = Public.gethealth

let getchats = Public.getchats

let getbalance = Assets.getbalance

let sendchildorder = Trade.sendchildorder
let me_sendchildorder = Trade.sendchildorder

let getchildorders = Trade.getchildorders
let me_getchildorders = Trade.getchildorders

let getexecutions = Trade.getexecutions
let me_getexecutions = Trade.getexecutions
24 changes: 20 additions & 4 deletions lib/bitflyerApi.mli
Original file line number Diff line number Diff line change
@@ -1,14 +1,30 @@
open Common

val getticker : product_code -> Ticker.response Lwt.t
val getmarkets : Json.t Lwt.t
val markets : Json.t Lwt.t

val getboard : product_code -> Json.t Lwt.t
val board : product_code -> Json.t Lwt.t

val getexecutions : product_code -> Json.t Lwt.t
val executions : product_code -> Json.t Lwt.t

val getboardstate : product_code -> Json.t Lwt.t

val gethealth : product_code -> string Lwt.t

val getchats : product_code -> Json.t Lwt.t

val getticker : product_code -> Public.ticker Lwt.t
val ticker : product_code -> Public.ticker Lwt.t

val getbalance : Auth.t -> Assets.balance list Lwt.t

val sendchildorder :
val me_sendchildorder :
Auth.t -> product_code -> order_type -> side -> float -> Json.t Lwt.t

val getchildorders :
val me_getchildorders :
Auth.t -> product_code -> Trade.order list Lwt.t

val getexecutions :
val me_getexecutions :
Auth.t -> product_code -> Trade.execution list Lwt.t
39 changes: 0 additions & 39 deletions lib/ticker.ml

This file was deleted.

0 comments on commit 82263d1

Please sign in to comment.