{"action":"created","issue":{"url":"https://api.github.com/repos/ccxt/ccxt/issues/661","repository_url":"https://api.github.com/repos/ccxt/ccxt","labels_url":"https://api.github.com/repos/ccxt/ccxt/issues/661/labels{/name}","comments_url":"https://api.github.com/repos/ccxt/ccxt/issues/661/comments","events_url":"https://api.github.com/repos/ccxt/ccxt/issues/661/events","html_url":"https://github.com/ccxt/ccxt/issues/661","id":276475343,"number":661,"title":"BitMEX private_get_position incorrect signature in Python/asyncio","user":{"login":"andersea","id":10992982,"avatar_url":"https://avatars1.githubusercontent.com/u/10992982?v=4","gravatar_id":"","url":"https://api.github.com/users/andersea","html_url":"https://github.com/andersea","followers_url":"https://api.github.com/users/andersea/followers","following_url":"https://api.github.com/users/andersea/following{/other_user}","gists_url":"https://api.github.com/users/andersea/gists{/gist_id}","starred_url":"https://api.github.com/users/andersea/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andersea/subscriptions","organizations_url":"https://api.github.com/users/andersea/orgs","repos_url":"https://api.github.com/users/andersea/repos","events_url":"https://api.github.com/users/andersea/events{/privacy}","received_events_url":"https://api.github.com/users/andersea/received_events","type":"User","site_admin":false},"labels":[{"id":604886964,"url":"https://api.github.com/repos/ccxt/ccxt/labels/bug","name":"bug","color":"ee0701","default":true}],"state":"closed","locked":false,"assignee":{"login":"kroitor","id":1294454,"avatar_url":"https://avatars3.githubusercontent.com/u/1294454?v=4","gravatar_id":"","url":"https://api.github.com/users/kroitor","html_url":"https://github.com/kroitor","followers_url":"https://api.github.com/users/kroitor/followers","following_url":"https://api.github.com/users/kroitor/following{/other_user}","gists_url":"https://api.github.com/users/kroitor/gists{/gist_id}","starred_url":"https://api.github.com/users/kroitor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kroitor/subscriptions","organizations_url":"https://api.github.com/users/kroitor/orgs","repos_url":"https://api.github.com/users/kroitor/repos","events_url":"https://api.github.com/users/kroitor/events{/privacy}","received_events_url":"https://api.github.com/users/kroitor/received_events","type":"User","site_admin":false},"assignees":[{"login":"kroitor","id":1294454,"avatar_url":"https://avatars3.githubusercontent.com/u/1294454?v=4","gravatar_id":"","url":"https://api.github.com/users/kroitor","html_url":"https://github.com/kroitor","followers_url":"https://api.github.com/users/kroitor/followers","following_url":"https://api.github.com/users/kroitor/following{/other_user}","gists_url":"https://api.github.com/users/kroitor/gists{/gist_id}","starred_url":"https://api.github.com/users/kroitor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kroitor/subscriptions","organizations_url":"https://api.github.com/users/kroitor/orgs","repos_url":"https://api.github.com/users/kroitor/repos","events_url":"https://api.github.com/users/kroitor/events{/privacy}","received_events_url":"https://api.github.com/users/kroitor/received_events","type":"User","site_admin":false}],"milestone":null,"comments":10,"created_at":"2017-11-23T21:39:53Z","updated_at":"2018-02-14T23:53:24Z","closed_at":"2018-02-14T23:53:24Z","author_association":"CONTRIBUTOR","body":"Hi. I am seeing something a bit odd. The async version of the exchange specific api call `private_get_position` fails with this error:\r\n```\r\nccxt.base.errors.AuthenticationError, bitmex GET https://testnet.bitmex.com/api/v1/position?filter=%7B%22isOpen%22%3A+true%2C+%22symbol%22%3A+%22XBTUSD%22%7D&columns=homeNotional%2CforeignNotional%2CmarkPrice 401 {\"error\":{\"message\":\"Signature not valid.\",\"name\":\"HTTPError\"}}\r\n```\r\nThe sync version works. \r\n\r\nHere is some test code:\r\n\r\n```python\r\n\"\"\"Application entry point.\"\"\"\r\nimport asyncio\r\nimport json\r\nimport ccxt\r\nimport ccxt.async as ccxt_async\r\nimport config\r\n\r\n\r\ndef test(symbol):\r\n    \"\"\"Position api test function.\"\"\"\r\n    bitmex = ccxt.bitmex({\r\n        **config.API_KEYS['bitmex'],\r\n        'nonce': ccxt.Exchange.milliseconds\r\n    })\r\n\r\n    bitmex.verbose = True\r\n    bitmex.urls['api'] = bitmex.urls['test']\r\n\r\n    return bitmex.private_get_position({\r\n        'filter': json.dumps({\r\n            \"isOpen\": True,\r\n            \"symbol\": symbol\r\n        }),\r\n        'columns': 'homeNotional,foreignNotional,markPrice'\r\n    })\r\n\r\nasync def test_async(symbol):\r\n    \"\"\"Position api test function.\"\"\"\r\n    bitmex = ccxt_async.bitmex({\r\n        **config.API_KEYS['bitmex'],\r\n        'nonce': ccxt.Exchange.milliseconds\r\n    })\r\n\r\n    bitmex.verbose = True\r\n    bitmex.urls['api'] = bitmex.urls['test']\r\n\r\n    return await bitmex.private_get_position({\r\n        'filter': json.dumps({\r\n            \"isOpen\": True,\r\n            \"symbol\": symbol\r\n        }),\r\n        'columns': 'homeNotional,foreignNotional,markPrice'\r\n    })\r\n\r\n\r\nif __name__ == '__main__':\r\n    print(test('XBTUSD'))\r\n    asyncio.get_event_loop().run_until_complete(test_async('XBTUSD'))\r\n```\r\nThis code expects a config.py with bitmex testnet api keys:\r\n```\r\nAPI_KEYS = {\r\n    'bitmex': {\r\n        'apiKey': 'key_id',\r\n        'secret': 'key_secret'\r\n    }\r\n}\r\n```\r\nAlso there should probably be an open BTXUSD position on the account to fetch.\r\n\r\nEnvironment:\r\n\r\n* Python 3.6.3 (default, Oct  3 2017, 21:45:48)\r\n* ccxt 1.10.196\r\n"},"comment":{"url":"https://api.github.com/repos/ccxt/ccxt/issues/comments/365784207","html_url":"https://github.com/ccxt/ccxt/issues/661#issuecomment-365784207","issue_url":"https://api.github.com/repos/ccxt/ccxt/issues/661","id":365784207,"user":{"login":"kroitor","id":1294454,"avatar_url":"https://avatars3.githubusercontent.com/u/1294454?v=4","gravatar_id":"","url":"https://api.github.com/users/kroitor","html_url":"https://github.com/kroitor","followers_url":"https://api.github.com/users/kroitor/followers","following_url":"https://api.github.com/users/kroitor/following{/other_user}","gists_url":"https://api.github.com/users/kroitor/gists{/gist_id}","starred_url":"https://api.github.com/users/kroitor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kroitor/subscriptions","organizations_url":"https://api.github.com/users/kroitor/orgs","repos_url":"https://api.github.com/users/kroitor/repos","events_url":"https://api.github.com/users/kroitor/events{/privacy}","received_events_url":"https://api.github.com/users/kroitor/received_events","type":"User","site_admin":false},"created_at":"2018-02-14T23:53:24Z","updated_at":"2018-02-14T23:53:24Z","author_association":"OWNER","body":"Fixed in #1905, ccxt version 1.10.1107. Thx to @kovalevvlad "}}
{"actor":{"display_login":"kroitor"}}