GithubHelp home page GithubHelp logo

zaifapiwrapper's People

Contributors

gentarok avatar

Watchers

 avatar

zaifapiwrapper's Issues

APIの更新

ドキュメントのバージョンが上がってないが、いくつかの機能追加があったみたいなので対応する。

typo

×Extention
○Extension

Jsonをマップする型の互換性について

各APIの返すJsonのデータには、ある程度共通しているものがある。
(PublicとFutureのLastPrice等。もしストリーミングに対応するならもっと。)

APIの戻り値については、こちらがコントロールできず、いつどんな変更が行われるか予測できないので全て個別の型にしていた。

でも、常識的には項目の追加はあっても削除・変更はあまり考えられないので、共通するデータを統一的に扱いたいケースは普通にありそう。

今のように分けるにしても、せめて同一の型からの派生型にしておいた方が良かったかも。
やるとしたらv2.0.0にしよう。

DateTimeOffsetを使ったほうが良い

DatetimeとUnixTimeの変換に拡張メソッドを用意していたが、DateTimeOffsetクラスにToUnixTimeMilliseconds ()やFromUnixTimeMilliseconds ()が用意されているので、標準のものを使おう。

nonceが加算されない

ApiClient.PostAsync()メソッド実行時にループを例外で脱出した場合、その後のAPI呼び出しで「nonce not incremented」が返される現象を確認

LeverageApi.CreatePositionAsyncで例外

System.Reflection.TargetInvocationException: 呼び出しのターゲットが例外をスローしました。 ---> System.Collections.Generic.KeyNotFoundException: 指定されたキーはディレクトリ内に存在しませんでした。
場所 System.Collections.Generic.Dictionary2.get_Item(TKey key) 場所 ZaifApiWrapper.LeverageApi.CreatePositionAsync(IDictionary2 parameters, CancellationToken token)
場所 ZaifApiWrapper.LeverageApi.CreatePositionAsync(String type, String currencyPair, String action, Decimal amount, Decimal price, Decimal leverage, Nullable1 groupId, Nullable1 limit, Nullable`1 stop, CancellationToken token)
--- 内部例外スタック トレースの終わり ---
場所 System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
場所 System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)
場所 System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
場所 SampleWinForm.Form1.<buttonExecute_Click>d__6.MoveNext() 場所 D:\Repos\GitHub\gentarok\ZaifApiWrapper\SampleWinForm\SampleWinForm\Form1.cs:行 60

同一APIキーで複数アプリからPOST系メソッドを利用されるとnonce not incrementedが発生する

考慮漏れというか何というか。
staticメンバに初期化で持たせた値をインクリメントしてるので、アプリをまたぐと防ぎようがない。

基本的には1アプリ1APIキーが理想なので制限にしてしまっても良さそう。
ただ、開発用のキーとかでコレが出るのは困るかもしれない。

実行直前に時間ベースでnonceを生成する方が良いかも。
精度の問題もあるので厳密な意味では同一かそれ以下を値を使ってしまう可能性があるけど、リトライのフローに流すことである程度は表面化しにくくなるはず。

APIでエラーとなった場合のリトライについて

現在は「please try later」という文字列が含まれるかどうかで判断しているが、どのようなメッセージが返されるか予測できないため、外部から正規表現パターンとして指定可能としたい。

(ApiClientOptionへのプロパティの追加とApiTimeoutRetryIntervalのプロパティ名の破壊的変更が必要だけど)

アセンブリの分割について

拡張性や保守性を高めるため、各APIクラスとHTTPの通信を行う内部コアロジックの部分はアセンブリを分割しても良いかもしれない(通信部分だけ使いまわしたいケースがあった)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.