Skip to content
This repository has been archived by the owner on Jan 20, 2020. It is now read-only.

TypeScript description for OrderResult#status is missing 'rejected' status #269

Closed
blair opened this issue Feb 19, 2018 · 1 comment
Closed

Comments

@blair
Copy link
Contributor

blair commented Feb 19, 2018

It is possible to post an order where the status is 'rejected', see the sample code in coinbase/coinbase-pro-trading-toolkit#149 .

The simple fix in gdax-tt:

- if ((result as any).message) {
+ if (result.status === 'rejected' || (result as any).message) {

generates this error message:

src/exchanges/gdax/GDAXExchangeAPI.ts(255,17): error TS2365: Operator '===' cannot be applied to types '"open" | "pending" | "received" | "done"' and '"rejected"'.

So gdax/index.d.ts needs to be updated.

@fb55
Copy link
Contributor

fb55 commented Feb 20, 2018

Fixed in #270

@fb55 fb55 closed this as completed Feb 20, 2018
fb55 pushed a commit to coinbase/coinbase-pro-trading-toolkit that referenced this issue Apr 20, 2018
* GDAXExchangeAPI: remove type unnecessary type assertion.

The type assertion is no longer necessary after gdax@0.7.0 was
released which includes coinbase/coinbase-pro-node#269 .

* Run `yarn upgrade gdax@0.7.0`.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

No branches or pull requests

2 participants