CrossmintSignerAuthRequiredCallback typedef

CrossmintSignerAuthRequiredCallback = Future<void> Function(String signerType, String signerLocator, bool needsAuth, CrossmintOtpSendCallback sendOtp, CrossmintOtpVerifyCallback verifyOtp, CrossmintOtpRejectCallback reject)

Callback fired when a non-custodial signer needs the user to authenticate.

The SDK passes:

  • signerType — "email" or "phone".
  • signerLocator — the identifier (email or phone number in E.164 form).
  • needsAuth — true when the challenge starts, false when it ends (e.g. after a successful verify).
  • sendOtp / verifyOtp / reject — callbacks that drive the flow.

Implementers show a UI prompt, call sendOtp to trigger delivery, then verifyOtp(code) on submission or reject() on cancel. The CrossmintWalletController.otp controller provides a ready-made implementation that marshalls the challenge through a ValueListenable — use that unless you need bespoke wiring.

Implementation

typedef CrossmintSignerAuthRequiredCallback =
    Future<void> Function(
      String signerType,
      String signerLocator,
      bool needsAuth,
      CrossmintOtpSendCallback sendOtp,
      CrossmintOtpVerifyCallback verifyOtp,
      CrossmintOtpRejectCallback reject,
    );