Core Ecosystem SDK

Configuration for Ecosystem core services.

Hierarchy

  • Openfort
    • Core

Constructors

  • Parameters

    Returns Core

Properties

eventsHandler: EventsHandler

Methods

  • Type Parameters

    • TAppState = any

    Parameters

    Returns Promise<void>

  • Logs the user out by flushing the signer and removing credentials.

    Returns Promise<void>

  • Parameters

    Returns Promise<TransactionIntentResponse>

  • Parameters

    Returns Promise<SessionResponse>

  • Parameters

    • code: string

    Returns Promise<UserProfile>

  • Returns Promise<null | User>

  • Parameters

    • Optional__namedParameters: {
          password?: string;
          session?: string;
      }
      • Optionalpassword?: string
      • Optionalsession?: string

    Returns Promise<UserProfile>

  • Returns an Ethereum provider using the configured signer.

    Parameters

    • Optionaloptions: {
          announceProvider: boolean;
          policy?: string;
      }

      Configuration options for the Ethereum provider.

      • announceProvider: boolean
      • Optionalpolicy?: string

    Returns Provider

    A Provider instance.

    If the signer is not an EmbeddedSigner.

  • Configures a session key and returns the session key details.

    Returns SessionKey

    A SessionKey object containing the address and registration status.

  • Configures an embedded signer.

    Parameters

    • OptionalchainId: null | number

      The chain ID for the embedded signer.

    • OptionalshieldAuthentication: null | ShieldAuthentication

      Shield authentication details.

    • OptionalrecoveryPassword: null | string

      Recovery password.

    Returns Promise<void>

  • Signs a message.

    Parameters

    • message: string | Uint8Array

      Message to sign.

    • Optionaloptions: {
          hashMessage?: boolean;
          arrayifyMessage?: boolean;
      }

      Additional options for signing.

      • OptionalhashMessage?: boolean
      • OptionalarrayifyMessage?: boolean

    Returns Promise<string>

    The signature.

    If no signer is configured.

  • Signs typed data.

    Parameters

    • domain: TypedDataDomain

      EIP-712 domain.

    • types: Record<string, TypedDataField[]>

      Typed data types.

    • value: Record<string, any>

      Typed data value.

    Returns Promise<string>

    The signature.

    If no signer is configured.

  • Exports the private key.

    Returns Promise<string>

    The private key.

    If no signer is configured.

  • Parameters

    • __namedParameters: {
          recoveryMethod: RecoveryMethod;
          recoveryPassword?: string;
          encryptionSession?: string;
      }
      • recoveryMethod: RecoveryMethod
      • OptionalrecoveryPassword?: string
      • OptionalencryptionSession?: string

    Returns Promise<void>

  • Logs in a user with email and password.

    Parameters

    • __namedParameters: {
          email: string;
          password: string;
          ecosystemGame?: string;
      }
      • email: string
      • password: string
      • OptionalecosystemGame?: string

    Returns Promise<AuthResponse>

    An AuthResponse object containing authentication details.

  • Signs up a new user with email and password.

    Parameters

    • __namedParameters: {
          email: string;
          password: string;
          options?: {
              data: {
                  name: string;
              };
          };
          ecosystemGame?: string;
      }
      • email: string
      • password: string
      • Optionaloptions?: {
            data: {
                name: string;
            };
        }
        • data: {
              name: string;
          }
          • name: string
      • OptionalecosystemGame?: string

    Returns Promise<AuthResponse>

    An AuthResponse object containing authentication details.

  • Links an email and password to an existing account using an authentication token.

    Parameters

    • __namedParameters: {
          email: string;
          password: string;
          authToken: string;
          ecosystemGame?: string;
      }
      • email: string
      • password: string
      • authToken: string
      • OptionalecosystemGame?: string

    Returns Promise<AuthPlayerResponse>

    An AuthPlayerResponse object.

  • Unlinks an email and password from an existing account using an authentication token.

    Parameters

    • __namedParameters: {
          email: string;
          authToken: string;
      }
      • email: string
      • authToken: string

    Returns Promise<AuthPlayerResponse>

    An AuthPlayerResponse object.

  • Requests an email verification link.

    Parameters

    • __namedParameters: {
          email: string;
          redirectUrl: string;
      }
      • email: string
      • redirectUrl: string

    Returns Promise<void>

  • Resets the user's password.

    Parameters

    • __namedParameters: {
          email: string;
          password: string;
          state: string;
      }
      • email: string
      • password: string
      • state: string

    Returns Promise<void>

  • Requests a password reset link.

    Parameters

    • __namedParameters: {
          email: string;
          redirectUrl: string;
      }
      • email: string
      • redirectUrl: string

    Returns Promise<void>

  • Verifies the user's email.

    Parameters

    • __namedParameters: {
          email: string;
          state: string;
      }
      • email: string
      • state: string

    Returns Promise<void>

  • Initializes an OAuth authentication process.

    Parameters

    • __namedParameters: {
          provider: OAuthProvider;
          options?: InitializeOAuthOptions;
          ecosystemGame?: string;
      }
      • provider: OAuthProvider
      • Optionaloptions?: InitializeOAuthOptions
      • OptionalecosystemGame?: string

    Returns Promise<InitAuthResponse>

    An InitAuthResponse object.

  • Initializes an OAuth linking process.

    Parameters

    • __namedParameters: {
          provider: OAuthProvider;
          authToken: string;
          options?: InitializeOAuthOptions;
          ecosystemGame?: string;
      }
      • provider: OAuthProvider
      • authToken: string
      • Optionaloptions?: InitializeOAuthOptions
      • OptionalecosystemGame?: string

    Returns Promise<InitAuthResponse>

    An InitAuthResponse object.

  • Unlinks an OAuth provider from the account.

    Parameters

    • __namedParameters: {
          provider: OAuthProvider;
          authToken: string;
      }
      • provider: OAuthProvider
      • authToken: string

    Returns Promise<AuthPlayerResponse>

    An AuthPlayerResponse object.

  • Polls for OAuth authentication completion.

    Parameters

    • key: string

      OAuth polling key.

    Returns Promise<AuthResponse>

    An AuthResponse object.

  • Authenticates using a third-party OAuth provider.

    Parameters

    • __namedParameters: {
          provider: ThirdPartyOAuthProvider;
          token: string;
          tokenType: TokenType;
          ecosystemGame?: string;
      }
      • provider: ThirdPartyOAuthProvider
      • token: string
      • tokenType: TokenType
      • OptionalecosystemGame?: string

    Returns Promise<AuthPlayerResponse>

    An AuthPlayerResponse object.

  • Initializes Sign-In with Ethereum (SIWE).

    Parameters

    • __namedParameters: {
          address: string;
          ecosystemGame?: string;
      }
      • address: string
      • OptionalecosystemGame?: string

    Returns Promise<SIWEInitResponse>

    A SIWEInitResponse object.

  • Authenticates using Sign-In with Ethereum (SIWE).

    Parameters

    • __namedParameters: {
          signature: string;
          message: string;
          walletClientType: string;
          connectorType: string;
      }
      • signature: string
      • message: string
      • walletClientType: string
      • connectorType: string

    Returns Promise<AuthResponse>

    An AuthResponse object.

  • Links a wallet using SIWE.

    Parameters

    • __namedParameters: {
          signature: string;
          message: string;
          walletClientType: string;
          connectorType: string;
          authToken: string;
      }
      • signature: string
      • message: string
      • walletClientType: string
      • connectorType: string
      • authToken: string

    Returns Promise<AuthPlayerResponse>

    An AuthPlayerResponse object.

  • Unlinks a wallet.

    Parameters

    • __namedParameters: {
          address: string;
          authToken: string;
      }
      • address: string
      • authToken: string

    Returns Promise<AuthPlayerResponse>

    An AuthPlayerResponse object.

  • Stores authentication credentials.

    Parameters

    • auth: Auth

      Authentication details.

    Returns void

  • Sends a signature transaction intent request.

    Parameters

    • transactionIntentId: string

      Transaction intent ID.

    • OptionalsignableHash: null | string

      User operation hash.

    • Optionalsignature: null | string

      Transaction signature.

    • Optionaloptimistic: boolean

      Whether the request is optimistic.

    Returns Promise<TransactionIntentResponse>

    A TransactionIntentResponse object.

    If no signableHash or signature is provided.

  • Returns Promise<CurrentAccount>

  • Sends a transaction signed with a session request.

    Parameters

    • sessionId: string

      Session ID.

    • signature: string

      Session signature.

    • Optionaloptimistic: boolean

      Whether the request is optimistic.

    Returns Promise<SessionResponse>

    A SessionResponse object.

  • Gets the embedded state of the current session.

    Returns EmbeddedState

    The embedded state.

  • Gets the current access token.

    Returns null | string

    The access token, or null if not available.

  • Retrieves the user details.

    Returns Promise<AuthPlayerResponse>

    An AuthPlayerResponse object.

    If no access token is found.

  • Validates and refreshes the access token if needed.

    Parameters

    • OptionalforceRefresh: boolean

    Returns Promise<void>