LykkeCity / Trading-API

Lykke Wallet API Trading Documentation. Trading API allows you to automate trading on the Lykke HFT account.
https://www.lykke.com/
Apache License 2.0
5 stars 5 forks source link

PlaceBulkLimitOrder via gRPC responds "ERROR: Code: Unknown Message: Exception was thrown by handler." #10

Open direktoren opened 3 years ago

direktoren commented 3 years ago

Bug Description I get an "Code: Unknown Message: Exception was thrown by handler" error when calling PlaceBulkLimitOrder either via grpcurl or my own code. Example:

order.json =

{
    "assetPairId": "KINETH",
    "cancelPreviousOrders": true,
    "orders": [
        {
            "side": 0,
            "volume": "100000",
            "price": "0.0000000050"
        }
    ]
}

Run the command:

cat order.json |grpcurl -rpc-header "authorization: Bearer APIKEY" -d @ hft-apiv2-grpc.lykke.com:443 hft.PrivateService.PlaceBulkLimitOrder

Where I replace APIKEY with my API Wallet apiKey that I can use without a problem for the other private apis using grpcurl.

Response:

ERROR:
  Code: Unknown
  Message: Exception was thrown by handler.

I get the same error message from my own code as displayed by grpcurl so I believe its the response comes from Lykke Trading-API not grpcurl itself. But I've been wrong before, so please advice.

I want also to show that I have reasons to believe I'm using grpcurl correctly. GetBalance api works fine like this:

grpcurl -rpc-header "Authorisation: Bearer APIKEY" hft-apiv2-grpc.lykke.com:443 hft.PrivateService.GetBalances

Screenshots N/A

Browser (please complete the following information):

Last upstream Slate commit (run git log --author="Robert Lord" | head -n 1): Latest

yar-sh commented 3 years ago

I know this issue is old, but I randomly stumbled upon this question when I was getting the same error.

The issue was that I was sending an incorrect assetPairId (typo, or such asset pair does not exist). In your case the "KIN/ETH" asset pair just does not exist on Lykke (though I am not sure if maybe it existed a ~year ago and the issue was actually something else for you (maybe some other wrong request data)): image

Hope that helps.