Service class for managing user related operations.

Hierarchy

  • ApiService
    • ProfileService

Methods

  • Adds a new customer account.

    Parameters

    Returns Promise<Account>

    A promise that resolves to the newly added customer account.

    Throws

    If the HTTP request fails.

    Example

    // Example usage:
    profileService.addAccount()
    .then((response) => {
    console.log(response);
    })
    .catch((error) => {
    console.error(`Error adding customer account.`);
    });
  • Retrieves customer accounts.

    Returns Promise<Account[]>

    A Promise that resolves to the retrieved customer accounts.

    Throws

    If the HTTP request fails.

    Example

    // Example usage:
    profileService.getAccounts()
    .then((response) => {
    console.log(response);
    })
    .catch((error) => {
    console.error(`Error fetching customer accounts.`);
    });
  • Retrieves customer information. By default, limited information is returned (include param is empty array). Use include parameter to add additional information into the response: ACCOUNTS - include account balance information RESTRICTIONS - include restriction information ADDRESS - include address information CONTACTINFO - include contact information

    Parameters

    • include: ProfileInclude[] = []

      The list of additional information to include in the response.

    Returns Promise<CustomerInfo>

    A Promise that resolves to the retrieved customer information.

    Throws

    If the HTTP request fails.

    Example

    // Example usage:
    profileService.getProfile()
    .then((response) => {
    console.log(response);
    })
    .catch((error) => {
    console.error(`Error fetching customer information.`);
    });
  • Retrieves customer account.

    Parameters

    • accountId: string

      The ID of the account to retrieve.

    Returns Promise<Account>

    A Promise that resolves to the retrieved customer account.

    Throws

    If the HTTP request fails.

    Example

    // Example usage:
    profileService.getSingleAccount()
    .then((response) => {
    console.log(response);
    })
    .catch((error) => {
    console.error(`Error fetching customer account.`);
    });
  • Updates customer personal information.

    Updating the following customer details might result in customer restriction and require new KYC Verification:

    • firstName, lastName - re-trigger KYC verification
    • address - re-trigger address verification of KYC process

    To update the following details, the customer must be non-KYC verified. If the customer is KYC verified, you cannot update these details:

    • birthDate

    Parameters

    Returns Promise<CustomerInfo>

    A Promise that resolves to the updated customer information.

    Example

    // Example usage:
    profileService.updateProfile(updateCustomerRequest)
    .then((response) => {
    console.log(response);
    })
    .catch((error) => {
    console.error(`Error updating customer information.`);
    });
  • Retrieves the singleton instance of the ProfileService class.

    Returns ProfileService

    The singleton instance of the ProfileService class.

    Function

    Static

    Example

    // Usage:
    const profileService = ProfileService.getInstance();