CrossmintNonCustodialSigner class abstract base

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.

Implemented types
Implementers

Constructors

CrossmintNonCustodialSigner({required CrossmintClient client, required HiddenSignerBridge bridge, required String type, required String locator, String? address, CrossmintSignerAuthRequiredCallback? onAuthRequired, CrossmintOtpDeliveryChannel? channel, CrossmintSignerBridgeClient? bridgeClient})
Creates a non-custodial signer. Prefer the chain-specific factory on CrossmintClient (e.g. createEvmNonCustodialSigner) over constructing this directly.

Properties

address → String?
The wallet address this signer approves for, if known at construction.
final
bridge → HiddenSignerBridge
The hidden signer WebView bridge that hosts the signing runtime.
final
canExportPrivateKey → bool
Whether this signer can export its private key. Only non-custodial email/phone signers return true.
no setteroverride
channel → CrossmintOtpDeliveryChannel?
OTP delivery channel for phone signers. Null means the service default (SMS). Ignored for email signers.
final
client → CrossmintClient
The client this signer belongs to.
final
exportKeyParams → ({CrossmintExportSignerEncoding encoding, CrossmintSignerKeyType keyType})
no setter
hashCode → int
The hash code for this object.
no setterinherited
locator → String
final
needsAuth → bool
true while an OTP challenge is outstanding.
no setter
onAuthRequired → CrossmintSignerAuthRequiredCallback?
Callback invoked when an OTP challenge starts or ends. Usually wired to CrossmintWalletController.onAuthRequired — which in turn surfaces a reactive challenge on CrossmintWalletController.otp.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
type → String
final

Methods

ensureAuthenticated() → Future<void>
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.
exportPrivateKey(CrossmintExportSignerBridge bridge) → Future<void>
Kicks off the key-export flow via the provided export bridge. The bridge renders a Crossmint-hosted UI that the user confirms inside. Throws CrossmintSignerException when the signer type does not support export.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
reject([Object? error]) → void
Cancels the pending OTP challenge. Fails the pending ensureAuthenticated future with CrossmintAuthRejectedException when no cause is supplied.
sendOtp() → Future<void>
(Re-)sends the OTP to the signer locator (email / phone). Meant to be invoked via CrossmintWalletOtpController.sendOtp during an active challenge.
sign({required CrossmintSignerKeyType keyType, required String bytes, required CrossmintSignerEncoding encoding}) → Future<String>
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.
signMessage(String message) → Future<String>
override
signTransaction(String transaction) → Future<String>
override
toString() → String
A string representation of this object.
inherited
verifyOtp(String otp) → Future<void>
Submits the OTP the user entered. Resolves the pending ensureAuthenticated future on success.

Operators

operator ==(Object other) → bool
The equality operator.
inherited