Skip to content

Commit

Permalink
Store entries
Browse files Browse the repository at this point in the history
  • Loading branch information
pxrl committed Dec 12, 2024
1 parent fda8381 commit 22e984e
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions api/_exclusivity/utils.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { ethers } from "ethers";
import { bnZero } from "../../src/utils/sdk";
import { RelayerFillLimit } from "../_types";
import { setCachedRelayerFillLimit } from "./cache";

export const MAX_MESSAGE_AGE_SECONDS = 300;

Expand Down Expand Up @@ -48,9 +49,12 @@ export async function updateLimits(
throw new Error("Relayer limits are overlapping");
}

// todo: Push each limit entry to the backend cache/db.
// The config types need to be reverted to strings as numbers.
relayer;

return;
await setCachedRelayerFillLimit(
relayer,
sortedLimits.map(({ minOutputAmount, maxOutputAmount, ...rest }) => ({
minOutputAmount: minOutputAmount.toString(), // @todo: Less bodge
maxOutputAmount: maxOutputAmount.toString(), // @todo: Less bodge
...rest,
}))
);
}

0 comments on commit 22e984e

Please sign in to comment.