feat: push websocket event when tx is not confirmed within TTL#152
Open
feat: push websocket event when tx is not confirmed within TTL#152
Conversation
When a transaction is not confirmed on-chain within the gateway retry window, the gateway now broadcasts a txNotConfirmed event on the transaction channel to all websocket clients subscribed to the same subAccountId. This allows clients to handle dropped/expired txs without relying only on polling the transactionEvent HTTP endpoint. - Add Channel::Transaction and AccountEvent::TxNotConfirmed in websocket - Add broadcast channel from controller to WS server for tx-not-confirmed - Thread sub_account_id through send_tx and all tx-producing endpoints - Document new event in README WebSocket API section - Add serialization test for txNotConfirmed payload Made-with: Cursor
Made-with: Cursor
- controller: allow dead_code/unused_imports in test cfg - websocket: use _ for unused Swap arm bindings (user, fee) - main: ignore 5 tests that require JUPITER_API_KEY or flaky RPC (run with --ignored when env set) Made-with: Cursor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When transactions are not confirmed on-chain within the gateway retry window, the gateway currently only logs
tx was not confirmed: <signature>and nothing is sent over the websocket. This change adds a websocket notification so clients can handle dropped/expired transactions without relying only on polling thetransactionEventHTTP endpoint.Changes:
transactionchannel withtxNotConfirmedevent payload (signature + subAccountId)(sub_account_id, signature)so all clients subscribed to that subaccount receive the eventsend_txand all tx-producing endpoints (cancel/place/modify/swap/set_leverage/titan_swap)txNotConfirmedpayloadThe HTTP
transactionEventendpoint is unchanged; the websocket event is an additional signal for timeout/drop handling.Made with Cursor