feat: bridge reconciliation + USDT provisioning additions#354
Open
heyolaniran wants to merge 26 commits into
Open
feat: bridge reconciliation + USDT provisioning additions#354heyolaniran wants to merge 26 commits into
heyolaniran wants to merge 26 commits into
Conversation
listByAccountId previously surfaced CouldNotListWalletsFromAccountIdError when Mongo returned no rows; callers treat an empty list more naturally.
Ensures device-upgrade login, BTC wallet balance field, and on-chain send-all query the correct Ibex account currency instead of relying on defaults.
Minors improvments in the creation of the Ibex address to link to the bridge card
this commit includes - fix: how to get the accessToken after Ibex login - feat: create an API call method to create the Ibex account for the flash account - fix: how to get the crypto receive options from Ibex Api call - feat: create an API call method to get the currency Id instead of hardcode it in USDT walletCurrency - fix: the ethereum USDT option method
this commit includes : - fix: Update the CryptoReceiveOption type - feat: Add the IbexCurrency type for Ibex currency - fix: update the cryptoReceiveInfo type
for usdt checking type wallet, the backend fetches the right currency Id from Ibex API call then create a new account with the API call method instead of the SDK
…o model Track unmatched vs resolved orphans, resolvedAt, and indexes for status and txHash queries. Extend the orphan service with resolveOrphansByTxHash and findOrphans helpers.
Introduce BridgeReconciliationUpdate so matched and unmatched reconciliation results can be broadcast to subscribers.
Use a 15-minute default window and payment_processed state for Bridge deposits. Add reconcileByTxHash for on-demand matching, orphan upserts, resolution of prior orphans on match, and PubSub events.
After persisting Bridge payment_processed with a destination tx hash, or after IBEX crypto.receive handling, fire reconcileByTxHash in the background with error logging only.
Add an admin bridgeReconciliationOrphans query with filtering, plus a public bridgeReconciliation subscription backed by the new PubSub trigger and typed payloads.
Pass an explicit window to the cron job and default the CLI script to a quarter-hour window to match real-time webhook reconciliation.
Cover batch reconciliation behavior and reconcileByTxHash paths including match, orphan creation, and PubSub publishing.
Describe batch versus real-time flows, orphan triage, and operational entry points for operators.
Format Bridge reconciliation pubsub.publish calls for readability.
Without this, accountDetailsByUserPhone (and any admin query returning wallets) throws INTERNAL_SERVER_ERROR on USDT wallet entries because the admin GraphQL schema has no concrete type to resolve Wallet → UsdtWallet.
Collaborator
Build is broken: WalletType is used as a runtime value without importing itEvidence:
Impact: |
Collaborator
|
Full Review Feedback:
|
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.
Summary
feature/bridge-integrationontotmp/bridge-rebase-pr-readyConflict resolutions
All conflicts resolved keeping the
tmp/bridge-rebase-pr-ready(HEAD) version for already-refactored code, and taking incoming changes for genuinely new functionality (e.g.usdtCashWalletguard before VA creation,currencyparameter on balance reads).Test plan
yarn test test/flash/unit/services/bridge/reconciliation.spec.tsyarn test test/flash/unit/services/bridge/index.spec.tsreconcileByTxHashbridgeReconciliationOrphansquery returns orphan records