Skip to main content
Abstract Base Class Base class for email / phone non-custodial signers.
Signing happens inside a hidden WebView (the Crossmint signer runtime) coordinated through CrossmintSignerBridgeClient. The SDK owns the WebView’s lifecycle via CrossmintWalletHost — if it is not mounted, attempting to use a non-custodial signer throws CrossmintSignerException(code: nonCustodialBridgeHostNotMounted). When authentication is needed, the signer calls onAuthRequired which surfaces the OTP challenge to UI (typically via CrossmintWalletController.otp). Concurrent callers are coalesced onto the same in-flight auth future to avoid double-prompting. Non-custodial signers are also CrossmintExportableWalletSigners — email/phone signers can export their private key via exportPrivateKey.

Constructors

CrossmintNonCustodialSigner

Creates a non-custodial signer. Prefer the chain-specific factory on CrossmintClient (e.g. createEvmNonCustodialSigner) over constructing this directly.

Properties

client

The client this signer belongs to.

bridge

The hidden signer WebView bridge that hosts the signing runtime.

type

locator

address

The wallet address this signer approves for, if known at construction.

onAuthRequired

Callback invoked when an OTP challenge starts or ends. Usually wired to CrossmintWalletController.onAuthRequired — which in turn surfaces a reactive challenge on CrossmintWalletController.otp.

needsAuth

true while an OTP challenge is outstanding.

canExportPrivateKey

Methods

ensureAuthenticated

Ensures the signer runtime has completed its authentication handshake, prompting the user via onAuthRequired if necessary. Concurrent callers share the same in-flight future — the user sees at most one prompt per auth cycle.

signMessage

signTransaction

sign

Low-level sign primitive — ensures auth, then invokes the signer bridge directly. Chain-specific subclasses wrap this with the encoding / key-type appropriate for their chain.

sendOtp

(Re-)sends the OTP to the signer locator (email / phone). Meant to be invoked via CrossmintWalletOtpController.sendOtp during an active challenge.

exportPrivateKey

verifyOtp

Submits the OTP the user entered. Resolves the pending ensureAuthenticated future on success.

reject

Cancels the pending OTP challenge. Fails the pending ensureAuthenticated future with CrossmintAuthRejectedException when no cause is supplied.