fix: add device signer to EVM adminSigner schemas [WAL-9475]#1726
fix: add device signer to EVM adminSigner schemas [WAL-9475]#1726albertoelias-crossmint wants to merge 1 commit intowallets-v1from
Conversation
…L-9475] Co-Authored-By: Alberto Elias <alberto.elias@paella.dev>
Original prompt from Alberto Elias
|
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
🦋 Changeset detectedLatest commit: 28ec7c9 The changes in this PR will be included in the next version bump. Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
Last reviewed commit: "fix: add device sign..." |
| { | ||
| "type": "object", | ||
| "properties": { | ||
| "type": { | ||
| "type": "string", | ||
| "enum": ["device"], | ||
| "description": "Identifier for device signer type" | ||
| }, | ||
| "publicKey": { | ||
| "type": "object", | ||
| "properties": { | ||
| "x": { | ||
| "type": "string", | ||
| "description": "The x coordinate of the p256 public key" | ||
| }, | ||
| "y": { | ||
| "type": "string", | ||
| "description": "The y coordinate of the p256 public key" | ||
| } | ||
| }, | ||
| "required": ["x", "y"], | ||
| "description": "The p256 public key of the device signer" | ||
| }, | ||
| "locator": { | ||
| "type": "string", | ||
| "description": "The locator of the signer" | ||
| }, | ||
| "name": { | ||
| "type": "string", | ||
| "description": "Optional human-readable name for the device signer" | ||
| } | ||
| }, | ||
| "required": ["type", "publicKey", "locator"], | ||
| "title": "Device Signer", | ||
| "description": "Configuration for a device signer", | ||
| "example": { | ||
| "type": "device", | ||
| "publicKey": { | ||
| "x": "decimal_string_x", | ||
| "y": "decimal_string_y" | ||
| }, | ||
| "locator": "device:BIVmCqMz8QJB+se2kJEpGQ...", | ||
| "name": "my-device" | ||
| } | ||
| } |
There was a problem hiding this comment.
🔴 Device signer added to Solana WalletV2025ResponseDTO instead of EVM
The PR's stated goal is to add the device signer to the EVM adminSigner schemas in both CreateWalletV2025DTO and WalletV2025ResponseDTO. The first hunk correctly adds it to the EVM smart wallet creation input in CreateWalletV2025DTO (~line 3503). However, the second hunk (~line 20394) adds the device signer to the Solana wallet output's adminSigner in WalletV2025ResponseDTO, not the EVM wallet output's adminSigner. The EVM wallet output section ends at line 20211 ("title": "EVM wallet output"), and the Solana section begins at line 20213 with "enum": ["solana"]. The insertion point at line 20394 falls squarely within the Solana schema.
After this PR:
WalletV2025ResponseDTO→ EVM wallet output →adminSignertypes:[external-wallet, server, api-key, passkey, email, phone]— still missingdeviceWalletV2025ResponseDTO→ Solana wallet output →adminSignertypes:[external-wallet, server, api-key, email, phone, device]— incorrectly gaineddevice
This means the TypeScript type error for EVM device signing responses remains unfixed, and Solana response types now incorrectly include device signer in adminSigner.
Prompt for agents
The device signer block at packages/wallets/src/openapi.json lines 20394-20439 was inserted into the wrong schema — it's inside the Solana wallet output's adminSigner oneOf array in WalletV2025ResponseDTO, but it should be in the EVM wallet output's adminSigner oneOf array.
1. Remove the device signer object (lines 20394-20439) from the Solana wallet output's adminSigner oneOf.
2. Add an equivalent device signer object (with the response-style fields: type, publicKey, locator, name, and required: [type, publicKey, locator]) to the EVM wallet output's adminSigner oneOf array. The EVM wallet output's adminSigner oneOf ends around line 20100 (after the phone signer entry). The EVM section is identified by "title": "EVM wallet output" at line 20211 and its config is described as "EVM wallet type specific configuration settings" at line 20180.
Was this helpful? React with 👍 or 👎 to provide feedback.
🔥 Smoke Test Results✅ Status: Passed Statistics
✅ All smoke tests passed!All critical flows are working correctly. This is a non-blocking smoke test. Full regression tests run separately. |
|
Closing this PR — the root cause was in the backend, not the SDK's openapi.json. The fix is in https://github.com/Paella-Labs/crossbit-main/pull/24208 which skips pre-flight signature verification for device signers in |
Description
Device signers (p256 keys stored on-device) were missing from the
adminSigneroneOf union in the OpenAPI spec for EVM wallets. The backend already supports device signers as admin signers, and they were already present in thedelegatedSignersschema, but theadminSignerschema was missing them in two DTOs:CreateWalletV2025DTO(EVM variant) — input schema, withoutlocatorWalletV2025ResponseDTO(EVM variant) — output schema, withlocatorrequiredThis gap caused the generated TypeScript types to not include device signers as valid admin signers, blocking EVM message signing flows (
signMessage/signTypedData) for wallets using device admin signers.The device signer schema was modeled after the existing device signer entry in
delegatedSignersfor consistency.Important for reviewer:
openapi.json. Verify this matches what the backend currently accepts/returns for device admin signers.adminSigner.locator(server-assigned); the output variant requires it.Test plan
pnpm test:vitest)pnpm lint)pnpm openapi-ts)adminSignermatches the existingdelegatedSignersdevice schemaPackage updates
@crossmint/wallets-sdk: patch — changeset added via.changeset/fix-device-signer-evm-admin.mdLink to Devin session: https://crossmint.devinenterprise.com/sessions/785824a317224383b6d6866abd96ccc6
Requested by: @albertoelias-crossmint