-
Notifications
You must be signed in to change notification settings - Fork 105
fix: Missing low wallet balance webhook #737
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
| } | ||
| }; | ||
|
|
||
| // TODO: Add retry logic upto |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was legacy from v1 and unused. Migrated to v2 queues and trigger it from mineTransactionWorker
| walletAddress: getAddress(resultTransaction.from), | ||
| }, | ||
| }); | ||
| logger({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removing unneeded logging.
| const _notifyIfLowBalance = async (transaction: MinedTransaction) => { | ||
| const { isUserOp, chainId, from } = transaction; | ||
| if (isUserOp) { | ||
| // Skip for userOps since they may not use the wallet's gas balance. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doesn't infinigods use smart wallet transactions?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
UserOps are primarily gas sponsored via Engine.
This check is useful for users sending non userOp transactions from backend wallets, which they're using too.
|
The wallet balance webhook is built to serve a case were we have few wallets or all the backend wallets are used to process arbitrary transactions. What if we have thousands and we only want to listen to funding wallets or only wallets used for gasless Txs ?? Can that feature be considered ? Instead of listening to all backend wallets then we have an array of wallets. |
PR-Codex overview
This PR focuses on refactoring the webhook handling for wallet balance notifications. It introduces a new type
BackendWalletBalanceWebhookParams, modifies existing webhook event processing, and implements a mechanism to notify when the wallet balance is low.Detailed summary
WalletBalanceWebhookSchematoBackendWalletBalanceWebhookParams.sendWebhookWorker.tsto handleWebhooksEventTypes.BACKEND_WALLET_BALANCE._enqueueBackendWalletBalanceWebhookmethod inSendWebhookQueue._notifyIfLowBalanceinmineTransactionWorkerto check and notify low wallet balances.sendBalanceWebhookfunction inwebhook.ts.