From 0f2a82322ca07d03de8c4e6b12cb39d3c09e2dbf Mon Sep 17 00:00:00 2001 From: Panos Halios Date: Fri, 20 Mar 2026 17:27:10 +0200 Subject: [PATCH] adding signer without the locator --- .../expo/components/headless-signing.tsx | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/apps/wallets/smart-wallet/expo/components/headless-signing.tsx b/apps/wallets/smart-wallet/expo/components/headless-signing.tsx index 5482fd2d2..a2e04fb0c 100644 --- a/apps/wallets/smart-wallet/expo/components/headless-signing.tsx +++ b/apps/wallets/smart-wallet/expo/components/headless-signing.tsx @@ -6,7 +6,7 @@ export function HeadlessSigning() { const { user } = useCrossmintAuth(); const { createDeviceSigner, wallet } = useWallet(); const loggedInUserEmail = user?.email ?? null; - const { needsAuth, sendEmailWithOtp, verifyOtp, reject } = useWalletOtpSigner(); + const { needsAuth, sendOtp, verifyOtp, reject } = useWalletOtpSigner(); const [isLoading, setIsLoading] = useState(false); @@ -40,8 +40,17 @@ export function HeadlessSigning() { } setIsLoading(true); try { - const descriptor = await createDeviceSigner(); - await wallet.addSigner(descriptor.locator); + const descriptor = await createDeviceSigner(wallet.address); + if (descriptor == null || descriptor.publicKey == null) { + throw new Error( + `Creating a device signer returned an invalid descriptor: ${descriptor == null ? String(descriptor) : JSON.stringify(descriptor, null, 2)}` + ); + } + await wallet.addSigner({ + type: "device", + publicKey: descriptor.publicKey, + name: descriptor.name, + }); } catch (error) { console.error("Error initializing wallet:", error); } finally { @@ -55,7 +64,7 @@ export function HeadlessSigning() { return; } - await handleAction(sendEmailWithOtp); + await handleAction(sendOtp); }; const handleVerifyOtpInput = async () => {