Skip to content

feat: Add support for EVM keyring wallets in generateWallet API#191

Merged
pranavjain97 merged 1 commit intomasterfrom
WAL-479
Apr 24, 2026
Merged

feat: Add support for EVM keyring wallets in generateWallet API#191
pranavjain97 merged 1 commit intomasterfrom
WAL-479

Conversation

@pranishnepal
Copy link
Copy Markdown
Contributor

What

This PR introduces support for generating EVM keyring wallets in the generateWallet API.

Ticket: WAL-479

Testing

@linear
Copy link
Copy Markdown

linear Bot commented Apr 21, 2026

@pranishnepal pranishnepal marked this pull request as ready for review April 21, 2026 23:04
@pranishnepal pranishnepal requested a review from a team as a code owner April 21, 2026 23:04
Comment on lines +26 to +28
if (evmKeyRingReferenceWalletId) {
return handleGenerateEvmKeyRingWallet(req);
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should be run after coin validation. if someone passes it with a non-EVM coin, the handler calls baseCoin.wallets().generateWallet() with an unsupported param and relies on the downstream API to reject it. should validate the coin is EVM-compatible and return 400 early imo

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point, added an early validation!

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you could directly do smthn like
if(baseCoin.isEVM() && evmKeyRingReferenceWalletId) {
result = await baseCoin.wallets().generateWallet(req.decoded);
}

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.


you could directly do smthn like
if(baseCoin.isEVM() && evmKeyRingReferenceWalletId) {
result = await baseCoin.wallets().generateWallet(req.decoded);
}

But this way, if they pass a non-EVM compatible coin, we won't error with a 400; we'd need to maintain another layer for if valid, if !valid logic. So, i feel like the helper function is useful here

Comment on lines +228 to +234
const { label, enterprise, evmKeyRingReferenceWalletId } = req.decoded;

const result = await baseCoin.wallets().generateWallet({
label,
enterprise,
evmKeyRingReferenceWalletId,
});
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why are we only selecting specific params? should send multisigType etc along and maybe there are other params it uses

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, right. The version of @bitgo-beta/sdk-core we're using has a mismatch against this package's schema.
The current version being used defines disableTransactionNotifications as a string, but here we have it as boolean.

If we get this bump PR in - #192 first, that should correct the typing in @bitgo-beta/sdk-core as well

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed!

@pranishnepal pranishnepal force-pushed the WAL-479 branch 5 times, most recently from 03b6277 to e340141 Compare April 23, 2026 20:25
This commit introduces support for generating EVM keyring wallets in
the `generateWallet` API.

Ticket: WAL-479
Comment on lines +220 to +225
/**
* This function generates an EVM keyring wallet by reusing keys from a reference wallet.
*/
async function handleGenerateEvmKeyRingWallet(
req: MasterApiSpecRouteRequest<'v1.wallet.generate', 'post'>,
) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this just wraps the generateWallet method and is repetetive of the main handler, we can remove this

Comment on lines +26 to +28
if (evmKeyRingReferenceWalletId) {
return handleGenerateEvmKeyRingWallet(req);
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you could directly do smthn like
if(baseCoin.isEVM() && evmKeyRingReferenceWalletId) {
result = await baseCoin.wallets().generateWallet(req.decoded);
}

@pranavjain97 pranavjain97 merged commit 56340b6 into master Apr 24, 2026
20 checks passed
@pranavjain97 pranavjain97 deleted the WAL-479 branch April 24, 2026 19:35
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.

2 participants