Basic Blueprint
Last updated
Was this helpful?
Last updated
Was this helpful?
The Basic Blueprint is a pre-designed template that helps you quickly build a basic version of an Agent, which can then be customized as needed.
: Allows the Agent owner to withdraw specified assets from the Agent.
: Enables acquiring specific notes from the FFP system, validating their validity, and submitting them for settlement.
: Monitors settlement notifications from the FFP settlement center and updates the notes and settlement status accordingly.
Below is an outline of the basic.lua file:
This function allows the Agent's owner to withdraw specified assets from the Agent.
Typical Scenarios:
The Agent owner withdraws profits.
Periodically clearing out remaining assets in the Agent.
This function enables the Agent to fetch a specific set of notes (Notes) from the FFP protocol, validate them, and submit them to the FFP protocol to create Settlement orders.
Key Code Logic:
Validate the notes (e.g., status, source, expiration date).
Call the StartSettle interface in the FFP protocol to generate settlement orders.
Execute settlement order logic (e.g., funds transfer).
This function listens for settlement completion notifications sent by the FFP protocol and updates the status of notes and settlement orders.
Main Purpose: To ensure that the status of notes and settlement orders saved by the Agent remains consistent with the status in the FFP protocol.
Copy the basic.lua and utils.lua code into your development environment.
Generally, there’s no need to modify the core functionality already implemented in basic.lua. Simply add additional functionality based on your specific business requirements.
The Basic Blueprint is the standard template for building FFP Agents. All FFP Agents are built on this foundation and extended with additional features to meet specific business needs. Through customized Agents, developers can easily integrate into the FusionFi protocol ecosystem and participate in various financial activities.
For example, you can build a within the FFP protocol.