stampLogin method

Future<TStampLoginResponse> stampLogin({
  1. required TStampLoginBody input,
})

Create a session for a user through stamping client side (API key, wallet client, or passkey client).

Sign the provided TStampLoginBody with the client's stamp function and submit the request (POST /public/v1/submit/stamp_login).

See also: stampStampLogin.

Implementation

Future<TStampLoginResponse> stampLogin({
  required TStampLoginBody input,
}) async {
  final body = packActivityBody(
    bodyJson: input.toJson(),
    fallbackOrganizationId: input.organizationId ??
        config.organizationId ??
        (throw Exception(
            "Missing organization ID, please pass in a sub-organizationId or instantiate the client with one.")),
    activityType: 'ACTIVITY_TYPE_STAMP_LOGIN',
  );
  return await request<Map<String, dynamic>, TStampLoginResponse>(
      "/public/v1/submit/stamp_login",
      body,
      (json) => TStampLoginResponse.fromJson(
          transformActivityResponse(json, 'StampLogin')));
}