SessionAuthPayload.fromRequestParams constructor

SessionAuthPayload.fromRequestParams(
  1. SessionAuthRequestParams params
)

Implementation

factory SessionAuthPayload.fromRequestParams(
  SessionAuthRequestParams params,
) {
  final now = DateTime.now();
  return SessionAuthPayload(
    chains: params.chains,
    domain: params.domain,
    nonce: params.nonce,
    aud: params.uri,
    type: params.type?.t ?? 'eip4361',
    version: '1',
    iat: DateTime.utc(
      now.year,
      now.month,
      now.day,
      now.hour,
      now.minute,
      now.second,
      now.millisecond,
    ).toIso8601String(),
    nbf: params.nbf,
    exp: params.exp,
    statement: params.statement,
    requestId: params.requestId,
    resources: params.resources,
  );
}