feat(wallets): add channel option for phone signer OTP delivery - #2002
Conversation
…via WhatsApp - Add channel to PhoneSignerConfig (sms | whatsapp) - Forward channel from phone signer descriptor into NcsSigner - Include channel in request:start-onboarding payload - Update @crossmint/client-signers StartOnboardingPayloadSchema to allow channel - Add tests for channel propagation Co-Authored-By: max@paella.dev <max@paella.dev>
Original prompt from Max
|
🤖 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: d36cf5d The changes in this PR will be included in the next version bump. This PR includes changesets to release 10 packages
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 |
Prompt To Fix All With AI### Issue 1
apps/wallets/quickstart-devkit/app/providers.tsx:302
The raw query-param string is spread into the SDK config without checking it's one of the accepted `"sms" | "whatsapp"` values. `createOnLogin` is typed as `any`, so TypeScript won't catch this, and an invalid value (e.g. `?channel=telegram`) will sail past the client and be rejected by the TEE's Zod schema with a cryptic validation error instead of an early, human-readable one.
```suggestion
const rawPhoneChannel = searchParams.get("channel");
const phoneChannel =
rawPhoneChannel === "sms" || rawPhoneChannel === "whatsapp" ? rawPhoneChannel : undefined;
```
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.Reviews (1): Last reviewed commit: "undo" | Re-trigger Greptile |
Description
Adds an optional
channeloption to the phone signer configuration so that OTPs can be delivered via WhatsApp as well as SMS.PhoneSignerConfignow acceptschannel?: "sms" | "whatsapp".channelin the internal signer config.NcsSigner.sendMessageWithOtpforwardschannelin therequest:start-onboardingpayload.@crossmint/client-signersStartOnboardingPayloadSchema.request.dataallows an optionalchannelfield.WalletFactorymerges the client-suppliedchannelback into API-returned phone signer configs, sincechannelis a client-only field that does not round-trip through the wallet-creation API.@crossmint/client-signersand@crossmint/wallets-sdk.Test plan
pnpm lintpasses.pnpm --filter @crossmint/wallets-sdk... buildsucceeds.pnpm --filter @crossmint/wallets-sdk test:vitestpasses, including the new phone signerchanneltest.Package updates
.changeset/whatsapp-channel.mdbumps@crossmint/client-signersand@crossmint/wallets-sdkas minor.Cross-repo dependencies
Crossmint/open-signer#211(TEEchannelsupport) andCrossmint/open-signer#212(frame forwarding ofchannel), andPaella-Labs/crossbit-main(relay validation/forwarding ofchannel).Link to Devin session: https://crossmint.devinenterprise.com/sessions/616ce59b2b1146ab96dd633e551f838e
Requested by: @maxsch-xmint