Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/api/info/_methods/_base/_schemas.ts
Original file line number Diff line number Diff line change
Expand Up @@ -348,6 +348,11 @@ export type UserFill = {
tid: number;
/** Token in which the fee is denominated (e.g., USDC). */
feeToken: string;
/**
* Fee trial escrow amount.
* @pattern ^[0-9]+(\.[0-9]+)?$
*/
feeTrialEscrow?: string;
/** ID of the TWAP. */
twapId: number | null;
};
Expand Down
2 changes: 1 addition & 1 deletion src/api/info/_methods/userFills.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export type UserFillsResponse = (UserFill & {
* Address of the liquidated user.
* @pattern ^0x[a-fA-F0-9]{40}$
*/
liquidatedUser: `0x${string}`;
liquidatedUser?: `0x${string}`;
/**
* Mark price at the time of liquidation.
* @pattern ^[0-9]+(\.[0-9]+)?$
Expand Down
2 changes: 2 additions & 0 deletions tests/api/info/userFills.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,15 @@ runTest({
{ user: "0x563C175E6f11582f65D6d9E360A618699DEe14a9" },
{ user: "0x8172cc20bc3a55dcd07c75dd37ac0c2534de3b84", aggregateByTime: true },
{ user: "0x563C175E6f11582f65D6d9E360A618699DEe14a9", aggregateByTime: false },
{ user: "0xd8cb8d9747f50be8e423c698f9104ee090540961" }, // feeTrialEscrow present
];

const data = await Promise.all(params.map((p) => client.userFills(p)));

schemaCoverage(paramsSchema, params);
schemaCoverage(responseSchema, data, [
"#/items/properties/twapId/defined",
"#/items/properties/liquidation/properties/liquidatedUser/missing",
]);
},
});
2 changes: 2 additions & 0 deletions tests/api/info/userFillsByTime.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ runTest({
{ user: "0x563C175E6f11582f65D6d9E360A618699DEe14a9", startTime: now - fiveYears, aggregateByTime: false },
{ user: "0x563C175E6f11582f65D6d9E360A618699DEe14a9", startTime: now - fiveYears, reversed: true },
{ user: "0x563C175E6f11582f65D6d9E360A618699DEe14a9", startTime: now - fiveYears, reversed: false },
{ user: "0xd8cb8d9747f50be8e423c698f9104ee090540961", startTime: now - fiveYears }, // liquidation without liquidatedUser
{ user: "0xd8cb8d9747f50be8e423c698f9104ee090540961", startTime: now - fiveYears, reversed: true }, // feeTrialEscrow present
];

const data = await Promise.all(params.map((p) => client.userFillsByTime(p)));
Expand Down
1 change: 1 addition & 0 deletions tests/api/info/userTwapSliceFills.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ runTest({
schemaCoverage(paramsSchema, params);
schemaCoverage(responseSchema, data, [
"#/items/properties/fill/properties/builderFee/present",
"#/items/properties/fill/properties/feeTrialEscrow/present",
"#/items/properties/fill/properties/twapId/defined",
]);
},
Expand Down
1 change: 1 addition & 0 deletions tests/api/info/userTwapSliceFillsByTime.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ runTest({
schemaCoverage(paramsSchema, params);
schemaCoverage(responseSchema, data, [
"#/items/properties/fill/properties/builderFee/present",
"#/items/properties/fill/properties/feeTrialEscrow/present",
"#/items/properties/fill/properties/twapId/defined",
]);
},
Expand Down
1 change: 1 addition & 0 deletions tests/api/subscription/userEvents.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ runTestWithExchange({
"#/anyOf/4/properties/twapHistory/items/properties/twapId/missing",
"#/anyOf/5/properties/twapSliceFills/items/properties/fill/properties/side/enum/1",
"#/anyOf/5/properties/twapSliceFills/items/properties/fill/properties/builderFee/present",
"#/anyOf/5/properties/twapSliceFills/items/properties/fill/properties/feeTrialEscrow/present",
"#/anyOf/5/properties/twapSliceFills/items/properties/fill/properties/twapId/defined",
]);
},
Expand Down
2 changes: 2 additions & 0 deletions tests/api/subscription/userFills.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@ runTest({
schemaCoverage(paramsSchema, params);
schemaCoverage(responseSchema, data, [
"#/properties/fills/items/properties/builderFee/present",
"#/properties/fills/items/properties/feeTrialEscrow/present",
"#/properties/fills/items/properties/twapId/defined",
"#/properties/fills/items/properties/liquidation/properties/liquidatedUser/missing",
"#/properties/isSnapshot/missing",
]);
},
Expand Down
1 change: 1 addition & 0 deletions tests/api/subscription/userTwapSliceFills.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ runTest({
schemaCoverage(paramsSchema, params);
schemaCoverage(responseSchema, data, [
"#/properties/twapSliceFills/items/properties/fill/properties/builderFee/present",
"#/properties/twapSliceFills/items/properties/fill/properties/feeTrialEscrow/present",
"#/properties/twapSliceFills/items/properties/fill/properties/twapId/defined",
"#/properties/isSnapshot/missing",
]);
Expand Down