bitbankapi クラス : TradeHistory(string,long,long,long,long,string) メソッド

説明

約定履歴を取得します。

構文

bitbankapiInstance.TradeHistory(string currencyPair, long count, long orderId, long since, long end, string order)

引数

クラス名前説明
stringcurrencyPair通貨ペア。
longcount取得数。
longorderId取引ID。
longsince開始UNIXタイムスタンプ。
longend終了UNIXタイムスタンプ。
stringorder並び順。"asc" or "desc"

返り値

クラス説明
bitbankres要求に対する応答、JSON文字列を持つ。

サンプルコード

1:

string apiKey = "3622c294-zs5m-587w-vv7j-sdf454h1sdbl";

2:

string secretKey = "4be789k3-dd7r-9d23-jy45-qng4c83hjk1g";

3:

bitbankapi bitbankapiIns = new bitbankapi(apiKey, secretKey);

4:

bitbankres bitbankresIns = bitbankapiIns.TradeHistory("btc_jpy", 10L, 0L, 0L, 0L, "");

5:

string jsonStr = bitbankresIns.Result;

JSON-text 例

{"success":1,"data":{"trades":[{"trade_id":23286271,"order_id":411169732,"pair":"btc_jpy","side":"buy","type":"market","amount":"0.0018","price":"790699","maker_taker":"taker","fee_amount_base":"0.00000000","fee_amount_quote":"0.0000","executed_at":1527541825000},{"trade_id":23286089,"order_id":411169354,"pair":"btc_jpy","side":"buy","type":"market","amount":"0.0040","price":"791861","maker_taker":"taker","fee_amount_base":"0.00000000","fee_amount_quote":"0.0000","executed_at":1527541772000},{"trade_id":23286087,"order_id":411169354,"pair":"btc_jpy","side":"buy","type":"market","amount":"0.0010","price":"791836","maker_taker":"taker","fee_amount_base":"0.00000000","fee_amount_quote":"0.0000","executed_at":1527541772000},{"trade_id":23285969,"order_id":411169026,"pair":"btc_jpy","side":"buy","type":"market","amount":"0.0250","price":"791871","maker_taker":"taker","fee_amount_base":"0.00000000","fee_amount_quote":"0.0000","executed_at":1527541724000},{"trade_id":22274881,"order_id":407381911,"pair":"btc_jpy","side":"sell","type":"market","amount":"0.0061","price":"917738","maker_taker":"taker","fee_amount_base":"0.00000000","fee_amount_quote":"0.0000","executed_at":1526989518000},{"trade_id":22274879,"order_id":407381911,"pair":"btc_jpy","side":"sell","type":"market","amount":"0.0100","price":"917739","maker_taker":"taker","fee_amount_base":"0.00000000","fee_amount_quote":"0.0000","executed_at":1526989518000},{"trade_id":22274877,"order_id":407381911,"pair":"btc_jpy","side":"sell","type":"market","amount":"0.0013","price":"917740","maker_taker":"taker","fee_amount_base":"0.00000000","fee_amount_quote":"0.0000","executed_at":1526989518000},{"trade_id":22274875,"order_id":407381911,"pair":"btc_jpy","side":"sell","type":"market","amount":"0.0013","price":"917865","maker_taker":"taker","fee_amount_base":"0.00000000","fee_amount_quote":"0.0000","executed_at":1526989518000},{"trade_id":22274873,"order_id":407381911,"pair":"btc_jpy","side":"sell","type":"market","amount":"0.0013","price":"917865","maker_taker":"taker","fee_amount_base":"0.00000000","fee_amount_quote":"0.0000","executed_at":1526989518000},{"trade_id":22274137,"order_id":407377888,"pair":"btc_jpy","side":"buy","type":"market","amount":"0.0200","price":"916255","maker_taker":"taker","fee_amount_base":"0.00000000","fee_amount_quote":"0.0000","executed_at":1526988919000}]}}

注意

非公開APIです。API キーと、秘密キーを設定しなければ情報を取得できません。

有効な第一引数 : btc_jpy, xrp_jpy, ltc_btc, eth_btc, mona_jpy, mona_btc, bcc_jpy, bcc_btc

第二から第五引数が必要ないときは、ゼロ以下の数値を指定してください。その引数は無視されます。

該当する通貨ペアの全ての約定履歴を取得するには、第二引数にゼロ以下の数値を指定してください。

第六引数は、結果のJSON-text内の約定履歴の時刻による並び順です。"asc"(昇順)か"desc"(降順)を指定してください。必要ないときは、空文字列を指定すれば無視されます。その場合の並び順は、降順("desc" : デフォルト値)になります。

要求に対する応答として bitbankres クラスのインスタンスが返ります。このインスタンスが応答の結果の JSON-text を保持しています。

引数が正しくない場合、以下の様な JSON-text が返ります。

{"success":0,"data":{"code":xxxxx}}

"code" は、それぞれのエラーで異なる番号になります。

HTTP エラーが発生した場合、以下の様な JSON-text が返ります。

{"success": -1000,"error": { "statuscode" : 404, "message": "Not Found"}}

"statuscode" と "message" は、それぞれの HTTP エラーで異なります。

要求がタイムアウトした場合、以下の JSON-text が返ります。

{"success": -1001,"error": { "typename" : "TaskCanceledException", "message": "タスクが取り消されました。"}}

その他の例外が発生して要求が失敗した場合、以下の様な JSON-text が返ります。

{"success": -1002,"error": { "typename" : "...", "message": "..."}}

"typename" と "message" は、それぞれの例外で異なります。

参照リンク

Copyright © Cooker All rights reserved.