gateio / gateapi-csharp

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Error when excute withdraw function

thanhphi0401 opened this issue · comments

Error message Attempt by method 'Io.Gate.GateApi.Client.ApiClient.Exec(RestSharp.RestRequest, Io.Gate.GateApi.Client.IReadableConfiguration)' to access method 'RestSharp.RestClient.AddHandler(System.Func1<RestSharp.Deserializers.IDeserializer>, System.String[])' failed

Parameters (screenshots)
Screenshot (3)

Please help me
Thank you

Please provide the full console message, the message you posted is not helpful for us to determine what the problem is

I got exactly the same error.
Full error message:

System.MethodAccessException
  HResult=0x80131510
  Message=Attempt by method 'Io.Gate.GateApi.Client.ApiClient.Exec(RestSharp.RestRequest, Io.Gate.GateApi.Client.IReadableConfiguration)' to access method 'RestSharp.RestClient.AddHandler(System.Func`1<RestSharp.Deserializers.IDeserializer>, System.String[])' failed.
  Source=Io.Gate.GateApi
  StackTrace:
   at Io.Gate.GateApi.Client.ApiClient.Exec[T](RestRequest req, IReadableConfiguration configuration)
   at Io.Gate.GateApi.Client.ApiClient.Get[T](String path, RequestOptions options, IReadableConfiguration configuration)
   at Io.Gate.GateApi.Api.FuturesApi.ListFuturesCandlesticksWithHttpInfo(String settle, String contract, Nullable`1 from, Nullable`1 to, Nullable`1 limit, String interval)
   at Io.Gate.GateApi.Api.FuturesApi.ListFuturesCandlesticks(String settle, String contract, Nullable`1 from, Nullable`1 to, Nullable`1 limit, String interval)
   at TestAPI.API.GateIO.TestAPI(String key, String secret) in C:\_program_dir_\GateIO.cs:line 25
   at TestAPI.frmMain.btnTestAPI_Click(Object sender, EventArgs e) in C:\_program_dir_\frmMain.cs:line 69
   at System.Windows.Forms.Control.OnClick(EventArgs e)
   at System.Windows.Forms.Button.OnClick(EventArgs e)
   at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
   at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at System.Windows.Forms.ButtonBase.WndProc(Message& m)
   at System.Windows.Forms.Button.WndProc(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, WM msg, IntPtr wparam, IntPtr lparam)

For your reference, this is my very simple TestAPI code. (C:_program_dir_\GateIO.cs)
image

Which version of RestSharp are you using? It seems the issue has something to do with RestSharp library

Found the problem. Since RestSharp 106.11.0, the signature of

public void AddHandler(Func<IDeserializer> deserializerFactory, params string[] contentTypes)

is changed. The public access modifier is removed. You can downgrade RestSharp to 106.10.x to circumvent the problem for now.

I'll try to figure out a way to get it working for 106.11.0+ versions.

4.20.2 has been published to NuGet, which resolves the problem RestSharp 106.11.0+ brings. It should appear in search results at a later time.

Thank you very much, it seems that the issue is resolved:)