feat: implement async mode for generateWallet#231
Merged
Conversation
When asyncModeConfig.enabled, handleGenerateOnChainWallet submits
directly to the bridge and returns { jobId, status: 'pending' } (202)
without touching AWM or BitGo.
We're only supporting multisig wallets for now.
Ticket: WCN-886
danielpeng1
approved these changes
Jun 11, 2026
danielpeng1
left a comment
Contributor
There was a problem hiding this comment.
feel free to address all these in a followup/next PR
Comment on lines
+45
to
+50
| const asyncResult = await submitJobViaBridgeClient(req, { | ||
| path: `/api/${req.params.coin}/key/independent`, | ||
| body: req.decoded, | ||
| sources: [KeySource.USER, KeySource.BACKUP], | ||
| operationType: 'multisig_keygen', | ||
| }); |
Contributor
There was a problem hiding this comment.
Is req.decoded the correct bridge body (not some other trimmed/transformed payload)?
Contributor
Author
There was a problem hiding this comment.
we're supposed to send the request as is - believe the typing is unknown 🤔
| const asyncApp = expressApp(asyncConfig); | ||
| const asyncAgent = request.agent(asyncApp); | ||
|
|
||
| const bridgeNock = nock(bridgeUrl).post(`/api/${coin}/key/independent`).reply(202, { jobId }); |
Contributor
There was a problem hiding this comment.
assert async tests for bridge contract (header and body) as we just have jobId and status here now.
Comment on lines
+159
to
+162
| if (req.config.asyncModeConfig.enabled) { | ||
| throw new BadRequestError('Async mode is not yet supported for TSS wallet generation'); | ||
| } | ||
|
|
Contributor
There was a problem hiding this comment.
add unit tests for async guards
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.
What
When
asyncModeConfig.enabled,handleGenerateOnChainWalletsubmits directly to the bridge and returns{ jobId, status: 'pending' }(202) without touching AWM or BitGo; we're only supporting multi-sig wallets for now.Ticket: WCN-886
Testing