Skip to content

feat(bridge): external account webhook + ENG-350 transfer failure reset - #373

Closed
heyolaniran wants to merge 22 commits into
lnflash:tmp/bridge-rebase-pr-readyfrom
heyolaniran:pr/eng-350-bridge-external-account
Closed

feat(bridge): external account webhook + ENG-350 transfer failure reset#373
heyolaniran wants to merge 22 commits into
lnflash:tmp/bridge-rebase-pr-readyfrom
heyolaniran:pr/eng-350-bridge-external-account

Conversation

@heyolaniran

@heyolaniran heyolaniran commented May 28, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • feat(externalAccounts): Adds POST /external-account webhook handler — fires after Plaid bank-linking completes, persists the linked account to MongoDB so bridgeExternalAccounts queries return results. Wires up signature verification, replay routing, and idempotency lock.
  • fix(ENG-350): Removes dead event === "transfer.failed" branch (Bridge sends transfer.updated.status_transitioned, not transfer.failed). Failure detection is now purely by terminal state value. Updates test samples and failure cases to use the real event type.
  • feat(bruno): Adds Bruno request files for bridgeAddExternalAccount, bridgeInitiateWithdrawal, bridgeExternalAccounts, and bridgeWithdrawals.

Test plan

  • Insert external account seed doc into bridgeexternalaccounts, query bridgeExternalAccounts — confirms id resolver and status mapping
  • Fire external_account.created via /internal/replay — confirms account persisted and idempotency on duplicate event
  • Insert pending withdrawal, fire transfer.updated.status_transitioned with a terminal state via /internal/replay — confirms status flips to failed and push notification dispatched
  • Duplicate webhook returns already_terminal, no double notification

forge0x and others added 22 commits May 25, 2026 16:11
…63 ENG-297 fix(bridge): apply audit hardening and hosted KYC refinements
Ready to merge.

Verified locally:
- `yarn check:sdl` passes
- targeted bridge/IBEX unit tests pass
- `git diff --check` passes

**squash & merge** used to keep `tmp/bridge-rebase-pr-ready` clean.
* ENG-297 fix(wallets): support USDT cash wallet parity

* fix(wallets): support USDT intraledger sends
* feat: add timeout for Bridge request
* feat(bridge): ENG-350 — reset withdrawal state on transfer.failed and surface failure reason
* feat(bridge): ENG-350 harden transfer webhook edge cases and notify users
* feat(bridge): ENG-350 introduce full KYC status lifecycle with offboarded support
* refactor(bridge): rename BridgeDepositLog model to BridgeDeposits
* refactor(ibex): rename IbexCryptoReceiveLog model to IbexCryptoReceive
* refactor(bridge): rename BridgeReplayLog model to BridgeReplay
* fix(bridge) : ENG-289 timeout increase to 15s
* feat: adding full kyc status to reflect them stored as bridgeKycStatus in mongoDB instead of just pending state
* feat: Kyc status
* fix: Duplicated webhook event message
* fix: Duplicated webhook deposit event message
* fix: Virtual Account Edge case
…esentation (lnflash#370)

* feat(cutover): add cash wallet migration state primitives

* feat(cutover): persist cash wallet cutover state

* feat(cutover): add cash wallet write guard

* feat(cutover): classify cash wallet migration candidates

* feat(cutover): add cash wallet preflight summary

* feat(cutover): collect cash wallet discovery results

* feat(cutover): plan primary cash wallet migrations

* feat(cutover): upsert planned migration records

* feat(cutover): prepare primary migration batch

* feat(cutover): start migration worker checkpoint

* feat(cutover): record migration source balance

* feat(cutover): create balance move invoice checkpoint

* feat(cutover): send balance move payment checkpoint

* feat(cutover): verify balance move checkpoint

* feat(cutover): create fee reimbursement invoice checkpoint

* feat(cutover): complete fee reimbursement checkpoint

* feat(cutover): flip default wallet checkpoint

* feat(cutover): complete migration worker checkpoints

* feat(cutover): provision destination checkpoint

* feat(cutover): dispatch migration worker steps

* feat(cutover): run locked migration batches

* feat(cutover): build migration step handlers

* feat(cutover): wire migration runtime services

* feat(cutover): orchestrate primary migration batches

* feat(cutover): add migration lifecycle controls

* fix(cutover): align migration indexes with run ids

* feat(cutover): add operator command script

* chore(cutover): format migration state helpers

* feat(cutover): preview dry-run migration plan

* fix(cutover): satisfy production build types

* feat(cutover): add operator controls and verification

* feat(cutover): add client-aware cash wallet presentation

* chore(cutover): clean operator artifact whitespace
* docs(bridge): add operations runbook

* docs(bridge): add cutover day runbook

* docs(bridge): tighten operations runbook safety

* docs(bridge): align cutover runbook with lifecycle behavior
feat: external accounts event triggering

this commit initialize the webhook endpoint to register on Bridge to trigger external account link after plaid completion
this commit mark the transfer as failed in our bridge withdrawals collection when something went wrong during the trasfer flow, the user is notified with a popup and on return state, as well for transfer successfully completed
Map "usdt" to "USD" and uppercase other currency codes so the push
notification shows a human-readable label instead of a raw enum value.
Replace email/password fields with clientId, clientSecret, and
environment ("production" | "sandbox") in the IbexConfig type, JSON
schema, and dev YAML config.
Replace the deprecated email/password sign-in flow with OAuth 2.0
client credentials (M2M). IbexClient now takes clientId/clientSecret/
environment, and getIbexToken posts to {authUrl}/oauth/token with
grant_type=client_credentials, caching the token until 60s before expiry.
@forge0x
forge0x force-pushed the tmp/bridge-rebase-pr-ready branch from d448b2b to 836405e Compare May 31, 2026 15:39
@islandbitcoin

Copy link
Copy Markdown
Contributor

Replaced by #379

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants