feat(bridge): split withdrawal into request, confirm, and cancel steps#387
Open
heyolaniran wants to merge 5 commits into
Open
Conversation
Introduce a two-step off-ramp flow so users review a pending withdrawal before Bridge is called, with deduplication, cancellation, and push notifications for the cancelled outcome.
Update bridge-integration docs to describe bridgeRequestWithdrawal, bridgeInitiateWithdrawal(withdrawalId), and bridgeCancelWithdrawalRequest.
Add Bruno mutations and query for request, initiate, cancel, and fetch pending withdrawal, with local env vars for bridgeWithdrawalId.
Required by the Bridge webhook schema so local write-sdl and config validation succeed.
Add bridgeRequestWithdrawal, bridgeCancelWithdrawalRequest, and bridgeWithdrawalRequest to the federated supergraph schema.
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
bridgeRequestWithdrawalvalidates and stores a pending record, thenbridgeInitiateWithdrawal(withdrawalId)submits to Bridge after user confirmation;bridgeCancelWithdrawalRequestcancels before submission.FLOWS.md/API.md.Breaking change
bridgeInitiateWithdrawalinput changed from{ amount, externalAccountId }to{ withdrawalId }. Clients must callbridgeRequestWithdrawalfirst.Commits
feat(bridge): split withdrawal into request, confirm, and cancel stepsdocs(bridge): document two-step withdrawal flow in FLOWS and APIchore(bruno): add GraphQL requests for bridge withdrawal flowfix(config): add external_account webhook public key to dev configchore(graphql): regenerate supergraph for bridge withdrawal mutationsTest plan
TEST="test/flash/unit/services/bridge/index.spec.ts test/flash/unit/app/bridge/send-withdrawal-notification.spec.ts" yarn test:unit(37 tests pass)bridgeRequestWithdrawalwith valid amount + verified external account returnspendingwithdrawalbridgeInitiateWithdrawal(withdrawalId)submits transfer and setsbridgeTransferIdbridgeCancelWithdrawalRequest(withdrawalId)marks withdrawalcancelledand sends push notificationwithdrawalIdreturnsBridgeWithdrawalNotFoundErrorBridgeWithdrawalAlreadyInitiatedError