Skip to content

PlaceMultipleOrdersAsync emits first error, but should return full data #64

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
yaroslavlsd opened this issue Mar 15, 2025 · 1 comment

Comments

@yaroslavlsd
Copy link

Data is null (but should not be, since this is batch request, each entry can return different error code and so on).
Although OKXOrderPlaceResponse has Code, Message

{
   "code":"1",
   "data":[
      {
         "clOrdId":"1425d83a94fbBCDEJKSpB3MVWDCky8bT",
         "ordId":"",
         "sCode":"51000",
         "sMsg":"Parameter sz error",
         "tag":"1425d83a94fbBCDE",
         "ts":"1742064981369"
      },
      {
         "clOrdId":"1425d83a94fbBCDEJKwEtqOqCUU6auai",
         "ordId":"",
         "sCode":"51001",
         "sMsg":"Instrument ID doesn't exist.",
         "tag":"1425d83a94fbBCDE",
         "ts":"1742064981369"
      }
   ],
   "inTime":"1742064981369740",
   "msg":"",
   "outTime":"1742064981369984"
}

var detailed = result.Data.Data.FirstOrDefault(x => !x.Success);
if (detailed != null)
return result.AsError<IEnumerable<OKXOrderPlaceResponse>>(new OKXRestApiError(detailed.Code, detailed.Message, null));
return result.AsError<IEnumerable<OKXOrderPlaceResponse>>(new OKXRestApiError(result.Data.ErrorCode, result.Data.ErrorMessage!, null));
}

Image

@yaroslavlsd
Copy link
Author

Same problem on cancel batch

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant