Description
User Story
As a user or developer, I want to enable intent-based order flows in the aggregator service, so that payment orders can leverage the new intent-based receive address and quoting mechanisms.
Acceptance Criteria
GIVEN the aggregator is configured,
WHEN an intent-based order is initiated,
THEN the system should validate required fields (such as slippage and return address), call the intent quote service, and update the receive address and transaction log with intent details.GIVEN a user sends a payment with an intent-based order,
WHEN the target network is Ethereum, Tron, Solana, or Bitcoin,
THEN the return address must be validated for the specific network type.GIVEN the intent quote service is called,
WHEN the call fails,
THEN a meaningful error message is returned to the user and logged.GIVEN a successful intent quote,
WHEN the deposit address is received,
THEN it is stored as the intent address on the receive address entity and reflected in both metadata and transaction logs.GIVEN a non-intent order is processed,
WHEN the order flow continues,
THEN it must not interact with intent-specific logic and must retain backward compatibility.GIVEN a payment order is initiated,
WHEN the metadata is constructed,
THEN all relevant fields (including intent flags, slippage, intent and receive addresses) must be captured in the logs for traceability.
Tech Details
- Added support for intent-based orders in the payment flow:
- Added new
IntentConfiguration
inconfig/intent.go
.- Updated controllers to initialize and use
clickDefuseService
for intent quotes.- Modified
SenderController
andController
to handle new intent-based logic, including validation and downstream service calls.- Updated ent schema for
ReceiveAddress
to include theintent_address
field and methods.- Ensured transaction logs and metadata capture intent-related information.
- PR: Feat/intent #474
Notes/Assumptions
- All changes are behind feature toggles where required and backward compatible.
- Integration is tested end-to-end within the aggregator context.
Open Questions