You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
When using the tradeAggregations call I accidentally sent improperly formatted dates. In doing so I passed the SDK's check, simply checking that I included dates, however when the request gets sent to Horizon it returns 400, with a message about my offset value being incorrect (even when this is not the case):
response:
{ type: 'https://stellar.org/horizon-errors/bad_request',
title: 'Bad Request',
status: 400,
detail: 'The request you sent was invalid in some way.',
extras:
{ invalid_field: 'offset',
reason: 'illegal or missing offset. offset must be a multiple of an hour, less than or equal to the resolution, and less than 24 hours' } } }
What version are you on?
Lastest and greatest: ^2.2.1
To Reproduce
const foo = async () => {
try {
const DAY = 86400000;
const WEEK = DAY * 7;
const asset = new StellarSdk.Asset("DRA", "GCJKSAQECBGSLPQWAU7ME4LVQVZ6IDCNUA5NVTPPCUWZWBN5UBFMXZ53");
let start = new Date();
start.setDate(start.getDate() - 365);
const end = new Date();
const resp = await server
.tradeAggregation(asset, StellarSdk.Asset.native(), start, end, WEEK, DAY)
.call();
return resp;
} catch (err) {
console.log(err);
}
};
Expected behavior
Failure at the SDK level saying invalid date format or something along those lines.
The text was updated successfully, but these errors were encountered:
Describe the bug
When using the
tradeAggregations
call I accidentally sent improperly formatted dates. In doing so I passed the SDK's check, simply checking that I included dates, however when the request gets sent to Horizon it returns 400, with a message about my offset value being incorrect (even when this is not the case):What version are you on?
Lastest and greatest:
^2.2.1
To Reproduce
Expected behavior
Failure at the SDK level saying
invalid date format
or something along those lines.The text was updated successfully, but these errors were encountered: