feat(blockchain): emit wallet_linked and wallet_link_failed events an… - #598
Merged
A6dulmalik merged 1 commit intoJul 25, 2026
Merged
Conversation
…d persist via BlockchainAnalyticsListener
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
Contributor
Author
|
@A6dulmalik kindly review, please check you telegram. sent you a mesage |
Contributor
Author
|
@phertyameen can you please review this |
A6dulmalik
approved these changes
Jul 25, 2026
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.
Closes #504
Description
Instrumented the
blockchainmodule using NestJSEventEmitter2to emitwallet_linkedandwallet_link_failedevents asynchronously without tightly couplingblockchaintoanalytics. AddedBlockchainAnalyticsListenerin theanalyticsmodule to persist these events directly into theAnalyticsEventdatabase table.Key Changes
LinkWalletDtoto validatePOST /blockchain/wallet/linkrequests.linkWalletinBlockchainServicethat fireswallet_linked(on success) orwallet_link_failed(on invalid address/failure) using non-blocking, fire-and-forgetsetImmediateevent emission.BlockchainAnalyticsListenerinbackend/src/analytics/listeners/blockchain-analytics.listener.tslistening to@OnEvent('wallet_linked')and@OnEvent('wallet_link_failed').BlockchainAnalyticsListenerinAnalyticsModuleproviders and exports.blockchain.service.spec.tsasserting fire-and-forget event payloads.blockchain-analytics.listener.spec.tsasserting event entity creation and persistence.Acceptance Criteria Checklist
wallet_linkedevent is emitted at the correct point in the blockchain flow on successful wallet linking.wallet_link_failedevent is emitted when wallet linking fails or is given an invalid address.BlockchainAnalyticsListenerpersists events with relevant metadata (userId,entityId,payload,timestamp).setImmediatewrapping), preventing listener failures from blocking request execution.Verification & Testing Performed
Unit Tests (6/6 Passed)