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
refactor: Simplify Monitor balance reporting and delete TokenTransferClient (#3111)
* improve: Add utility functions for inventory equivalence remapping, Binance deposit matching, and floatToBN fix
- TokenUtils: getInventoryEquivalentL1TokenAddress, getInventoryBalanceContributorTokens, isL2OnlyEquivalentToken
- RunningBalanceUtils: getLatestRunningBalances extracted for shared use
- BinanceUtils: getOutstandingBinanceDeposits for cross-L2 deposit matching, export BinanceDeposit type
- BNUtils: Fix floatToBN MAX_SAFE_INTEGER overflow via string manipulation
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* improve: Use inventory equivalence remapping in BundleDataApproxClient, InventoryClient, TokenClient
- BundleDataApproxClient: returns values in L1 token decimals, groups deposits/refunds across
inventory-equivalent L2 tokens, restores requireExecution param, fixes refund decimal conversion
- InventoryClient: uses getInventoryEquivalentL1TokenAddress, getInventoryBalanceContributorTokens,
getLatestRunningBalances; adds protected getTokenInfo for test mocking
- TokenClient: uses getInventoryBalanceContributorTokens for L2 token discovery
- Test updates: alias config for USDC, L1-decimal refunds, MockInventoryClient getTokenInfo override
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* improve: Fix Binance CEX pending withdrawal logic and adapter cleanup
- BinanceCEXBridge: rewrite getL2PendingWithdrawalAmount to correctly compute outstanding
deposits when finalizer batches deposits from multiple L2s into single L1 withdrawal.
Uses getOutstandingBinanceDeposits with Redis-cached deposit sender lookups.
- BaseChainAdapter: use getInventoryEquivalentL1TokenAddress, skip zero-amount outstanding
transfers in getOutstandingCrossChainTransfers
- AdapterManager: minor cleanup
- MockLineaEvents: accept amount parameter for BridgingInitiatedV2/BridgingFinalizedV2
- Generic adapter tests: updated for zero-amount skip behavior
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* Update InventoryClient.InventoryRebalance.ts
* refactor: Simplify Monitor balance reporting and delete TokenTransferClient
- Monitor.reportRelayerBalances: rewritten to use getInventoryBalanceContributorTokens for
per-chain L2 token discovery, batch-fetch all balances in parallel, produce aligned table
per token. Adds protected getTokenInfo for test mocking. Fixes pending rebalance double-count
by only applying to canonical L2 token.
- MonitorConfig: removes L2Token interface, l2OnlyTokens, L2_ONLY_TOKENS env var
- MonitorClientHelper: removes TokenTransferClient construction
- Delete TokenTransferClient (no longer needed)
- Delete unused BalanceType/RelayerBalanceReport/TokenTransfer interfaces
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* Update Monitor.ts
* Update Monitor.ts
* Update Monitor.ts
* Fix various issues:
- MonitorClientHelper: Should filter out duplicate spoke pool address strings passed into AdapterManager
- AdapterManager: should filter out hub/spoke pool addresses from monitored addresses passed to BaseChainAdapter if the token doesn't have a pool rebalance route to that chain.
- BaseChainAdapter: computes outstanding l1->l2 transfer amount using net amount approach rather than marking off events one by one, which better supports adapters with Binance which don't have this 1:1 relationship assumption
* Fix tests, change monitor logging to be mobile-friendly, fix base chain adapter codex suggestion
* Fix tests
* lint
---------
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
0 commit comments