Class FederatedKeylessAccount

Account implementation for the FederatedKeyless authentication scheme.

Used to represent a FederatedKeyless based account and sign transactions with it.

Use FederatedKeylessAccount.create to instantiate a KeylessAccount with a JWT, proof, EphemeralKeyPair and the address the JWKs are installed that will be used to verify the JWT.

When the proof expires or the JWT becomes invalid, the KeylessAccount must be instantiated again with a new JWT, EphemeralKeyPair, and corresponding proof.

Hierarchy (view full)

Constructors

Properties

accountAddress: AccountAddress

Account address associated with the account

aud: string

The value of the 'aud' claim on the JWT, also known as client ID. This is the identifier for the dApp's OIDC registration with the identity provider.

ephemeralKeyPair: EphemeralKeyPair

The EphemeralKeyPair used to generate sign.

jwt: string

The JWT token used to derive the account

pepper: Uint8Array

A value contains 31 bytes of entropy that preserves privacy of the account. Typically fetched from a pepper provider.

proof: undefined | ZeroKnowledgeSig

The zero knowledge signature (if ready) which contains the proof used to validate the EphemeralKeyPair.

proofOrPromise: ZeroKnowledgeSig | Promise<ZeroKnowledgeSig>

The proof of the EphemeralKeyPair or a promise that provides the proof. This is used to allow for awaiting on fetching the proof.

The FederatedKeylessPublicKey associated with the account

signingScheme: SigningScheme

Signing scheme used to sign transactions

uidKey: string

The claim on the JWT to identify a user. This is typically 'sub' or 'email'.

uidVal: string

The value of the uidKey claim on the JWT. This intended to be a stable user identifier.

PEPPER_LENGTH: number = 31

Methods

  • Serializes a Serializable value to its BCS representation. This function is the Typescript SDK equivalent of bcs::to_bytes in Move.

    Returns Uint8Array

    the BCS representation of the Serializable instance as a byte buffer