Skip to main content

luna.engine.local_functions

LocalFunctionRunner Objects

class LocalFunctionRunner()

Class: LocalFunctionRunner

A local implementation of the Luna function runner. This class provides the functionality to execute predefined Luna functions within a local environment.

Key Functionalities:

  • Fetching Current Time: Retrieves the current time using a local clock.
  • Creating Balance Sheet Events and Accounts: Generates unique identifiers for new balance sheet events and accounts.
  • Performing Simple Transfers: Handles the operation of simple asset transfers.
  • Setting Up Default Payment Accounts: Provides the setup for default payment accounts in the local environment.

Usage:

This class is utilized in scenarios where Luna functions need to be executed locally, without the need for remote engine communication.

run

def run(name: str, args: dict) -> Dict[str, str]

Executes a Luna function based on the provided name and arguments.

Arguments:

  • name (str): The name of the function to execute.
  • args (dict): A dictionary of arguments required for the function execution.

Returns:

  • Dict[str, str]: The result of the function execution.

Raises:

  • LunaException: If the function name does not match any local implementation.