This repository has been archived by the owner on Oct 11, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 264
/v2/orderbook: Pagination defaults to page 0. SRA spec defines page 1. #31
Labels
bug 🪲
Something isn't working
Comments
.. and Thanks :) |
@laurengarcia this one I can't reproduce. Seems like your response is returning page 1 some how and not page 0 in the 0x Connect response. But the curl returns page 0 since no pagination params are given. Are you using any import { HttpClient } from '@0x/connect';
const client = new HttpClient('http://localhost:3000/v2');
const baseAssetData = '0xf47261b00000000000000000000000002002d3812f58e35f0ea1ffbf80a75a38c32175fa';
const quoteAssetData = '0xf47261b0000000000000000000000000d0a1e359811322d97991e03f863a0c30c2cf029c';
client.getOrderbookAsync(
{ "baseAssetData": baseAssetData,
"quoteAssetData": quoteAssetData
})
.then(
(r) => console.log(JSON.stringify(r, null, 2)),
(e) => console.log(e)
) With the response: {
"bids": {
"total": 0,
"page": 0,
"perPage": 20,
"records": []
},
"asks": {
"total": 2,
"page": 0,
"perPage": 20,
"records": [
{
"metaData": {},
"order": {
"signature": "0x1b2217d8efad41909d1f759f64bd2a471639e3d17340ed736bb33ace4641e8f2097ff3d6c1f7dbc51d28e323e0becbe410808be125c0b9f15b8ef4b7c1f5b4a27c02",
"senderAddress": "0x0000000000000000000000000000000000000000",
"makerAddress": "0x5409ed021d9299bf6814279a6a1411a7e866a631",
"takerAddress": "0x0000000000000000000000000000000000000000",
"makerFee": "0",
"takerFee": "0",
"makerAssetAmount": "100000000000000000000000",
"takerAssetAmount": "100000000000000000000",
"makerAssetData": "0xf47261b00000000000000000000000002002d3812f58e35f0ea1ffbf80a75a38c32175fa",
"takerAssetData": "0xf47261b0000000000000000000000000d0a1e359811322d97991e03f863a0c30c2cf029c",
"salt": "4997075760802117905243536649051906104008891540108681218169938513821289690431",
"exchangeAddress": "0x35dd2932454449b14cee11a94d3674a936d5d7b2",
"feeRecipientAddress": "0x0000000000000000000000000000000000000000",
"expirationTimeSeconds": "1646079500783"
}
},
{
"metaData": {},
"order": {
"signature": "0x1cb5245d5c90a2561502d6a9f01002ac476ca51a324f3e4b26870f41ca24d3a7e54d01c59083977b92e0534642378186ee173bb33d8dbb16d03ac60fb7db962a6a02",
"senderAddress": "0x0000000000000000000000000000000000000000",
"makerAddress": "0x5409ed021d9299bf6814279a6a1411a7e866a631",
"takerAddress": "0x0000000000000000000000000000000000000000",
"makerFee": "0",
"takerFee": "0",
"makerAssetAmount": "100000000000000000000",
"takerAssetAmount": "100000000000000000",
"makerAssetData": "0xf47261b00000000000000000000000002002d3812f58e35f0ea1ffbf80a75a38c32175fa",
"takerAssetData": "0xf47261b0000000000000000000000000d0a1e359811322d97991e03f863a0c30c2cf029c",
"salt": "48421664369936352591469907962264571897462657488340054914166087266166526899713",
"exchangeAddress": "0x35dd2932454449b14cee11a94d3674a936d5d7b2",
"feeRecipientAddress": "0x0000000000000000000000000000000000000000",
"expirationTimeSeconds": "1547623505418"
}
}
]
}
} Matching the curl output:
|
My bad! Was indeed passing in pagination params and didn't realize that http://sra-spec.s3-website-us-east-1.amazonaws.com/#operation/getOrderbook |
Yeah I agree, 0 indexed pagination is non-standard. |
dekz
changed the title
/v2/orderbook: Empty records field when queried via 0x Connect
/v2/orderbook: Pagination defaults to page 0. SRA spec defines page 1.
Jan 20, 2019
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
@dekz - Found another one:
When I hit local Launch Kit (.ts version) endpoint via curl /v2/orderbook it is properly returning bids and asks.
But when i use the 0x Connect client for the exact same query it doesn't return the actual records with the rest of the response. Records field is always empty in the response:
Here's what the curl response for same exact query looks like, seems correct:
The text was updated successfully, but these errors were encountered: