Skip to content
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

Support for subaccounts/program name #115

Closed
quazzuk opened this issue May 4, 2021 · 3 comments · Fixed by #117
Closed

Support for subaccounts/program name #115

quazzuk opened this issue May 4, 2021 · 3 comments · Fixed by #117
Assignees

Comments

@quazzuk
Copy link

quazzuk commented May 4, 2021

Describe the bug
rest_execution_management_simple doesn't appear to support subaccounts/program name despite the usage message indicating it does i.e. "Usage: <program name> get_open_orders <symbol>

To Reproduce

  1. build examples
  2. attempt to run rest_execution_management_simple example as usage suggests i.e. main get_open_orders BTCUSD

Expected behavior

Correct subaccount is passed to the api, in my case FTX. Instead I get either "Please provide the first command line argument from this list:" if passing the subaccount or if I leave out, then I get an error message from the api indicating I only have permissions for subaccount "foo".

It looks like the Request object doesn't support subaccounts.

@quazzuk
Copy link
Author

quazzuk commented May 4, 2021

From grepping the source it looks like I can set the FTX_API_SUBACCOUNT environment variable however I'm still having trouble getting it to work...

@quazzuk
Copy link
Author

quazzuk commented May 4, 2021

looks like adding

auto apiSubaccountName = mapGetWithDefault(credential, this->apiSubaccountName);
req.set("FTX-SUBACCOUNT", apiSubaccountName)

to convertReq fixes the issue but really the example needs updating to reflect this.

Do you want a PR?

@cryptochassis
Copy link
Contributor

looks like adding

auto apiSubaccountName = mapGetWithDefault(credential, this->apiSubaccountName);
req.set("FTX-SUBACCOUNT", apiSubaccountName)

to convertReq fixes the issue but really the example needs updating to reflect this.

Do you want a PR?

Sure. Thank you.

@cryptochassis cryptochassis linked a pull request May 8, 2021 that will close this issue
@cryptochassis cryptochassis self-assigned this May 8, 2021
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

Successfully merging a pull request may close this issue.

2 participants