Class default

Main client class for all activities.

Hierarchy

  • default

Constructors

  • Login to your MB account via username and password.

    Parameters

    • data: {
          username: string;
          password: string;
      }

      Your MB Bank login credentials: username and password.

      • username: string

        Your MB Bank login username, usually your registered phone number.

      • password: string

        Your MB Bank login password.

    Returns default

Properties

username: string

Your MB account username.

password: string

Your MB account password.

sessionId: undefined | null | string

MB-returned Session ID. Use it to validate the request.

deviceId: string = ...

Your non-unique, time-based Device ID.

client: Client = ...

Undici client. Use it for sending the request to API.

wasmData: Buffer

WASM Buffer, downloaded from MB.

Methods

  • A private function to process MB's captcha and get Session ID.

    Returns Promise<boolean>

  • A private function to calculate the reference ID required by MB.

    Returns string

    The reference ID that is required by MB.

  • Parameters

    • data: {
          path: string;
          json?: object;
          headers?: object;
      }
      • path: string
      • Optional json?: object
      • Optional headers?: object

    Returns Promise<any>

  • Gets your account's balance info.

    Returns Promise<undefined | BalanceList>

    Your MB account's balance object.

  • Gets all your transactions on MB.

    Parameters

    • data: {
          accountNumber: string;
          fromDate: string;
          toDate: string;
      }

      The data that function requires.

      • accountNumber: string

        The MB's account number needs to be checked.

      • fromDate: string

        The date you want to start looking up, format dd/mm/yyyy. Make sure this is not smaller than 90 days from the ending date.

      • toDate: string

        The date you want to end the lookup, format dd/mm/yyyy. Make sure this is not bigger than 90 days from the starting date.

    Returns Promise<undefined | TransactionInfo[]>

    TransactionInfo object as an array, see TransactionInfo for more details.

    Example

    If you want to get transactions history from account "1234567890", from 1/12/2023 to 1/1/2024:

    <MB>.getTransactionsHistory({ accountNumber: "1234567890", fromDate: "1/12/2023", toDate: "1/1/2024" });
    

Generated using TypeDoc