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

OrderbookLevelV5 should be a pair of strings #315

Closed
nullobject opened this issue Feb 13, 2024 · 4 comments
Closed

OrderbookLevelV5 should be a pair of strings #315

nullobject opened this issue Feb 13, 2024 · 4 comments

Comments

@nullobject
Copy link

nullobject commented Feb 13, 2024

The OrderbookLevelV5 type looks like this:

export default interface OrderbookLevelV5 {
  price: string;
  size: string;
}
export interface OrderbookResponseV5 {
  s: string;
  b: OrderbookLevelV5[];
  a: OrderbookLevelV5[];
  ts: number;
  u: number;
}

but it does not match the Bybit Get Orderbook API definition:

{
    "retCode": 0,
    "retMsg": "OK",
    "result": {
        "s": "BTCUSDT",
        "a": [
            [
                "16638.64",
                "0.008479"
            ]
        ],
        "b": [
            [
                "16638.27",
                "0.305749"
            ]
        ],
        "ts": 1672765737733,
        "u": 5277055
    },
    "retExtInfo": {},
    "time": 1672765737734
}

The OrderbookLevelV5 type should be a pair of strings:

export type OrderbookLevelV5 = [string, string];
@tiagosiebler
Copy link
Owner

Based on what you found, you're absolutely right. Let me just double check that this type isn't used elsewhere (whether we can update it or if we need a new type for this particular endpoint).

@tiagosiebler
Copy link
Owner

Will be fixed in v3.9.2 as soon as #316 merges. Thanks for reporting this.

tiagosiebler added a commit that referenced this issue Feb 13, 2024
v3.9.2: fix(#315) orderbook level type
@tiagosiebler
Copy link
Owner

Fixed via #316

@nullobject
Copy link
Author

Thanks for fixing this @tiagosiebler.

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

2 participants