Skip to content

improve(monitor): Overhaul monitor config#2906

Open
pxrl wants to merge 3 commits intomasterfrom
pxrl/balanceConfig
Open

improve(monitor): Overhaul monitor config#2906
pxrl wants to merge 3 commits intomasterfrom
pxrl/balanceConfig

Conversation

@pxrl
Copy link
Copy Markdown
Collaborator

@pxrl pxrl commented Jan 30, 2026

As was done with the refiller config, compress the monitor config to
make it more manageable.

Additionally, prefer the new refiller config over the old during the
transition phase.

As was done with the refiller config, compress the monitor config to
make it more manageable.
if (MONITORED_BALANCES) {
const validate = (chainId: number, account: string, warnThreshold: number, errorThreshold: number) => {
if (!isDefined(errorThreshold) && !isDefined(warnThreshold)) {
throw new Error("Must provide either an errorThreshold or a warnThreshold");
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we throw even if just one value of error/warn threshold is not provided?
Tbh, i would prefer it more like that

Comment thread src/monitor/MonitorConfig.ts Outdated
Object.entries(config).forEach(([account, chainConfig]) => {
Object.entries(chainConfig).forEach(([_chainId, tokenConfig]) => {
const chainId = Number(_chainId);
const { warnThreshold, errorThreshold, token } = tokenConfig;
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think tokenConfig probably needs to be an array to permit multiple tokens to be monitored for a given account per chain.

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

Successfully merging this pull request may close these issues.

2 participants