refactor(modules/amm): rename swap_plan to swap_exact_in_plan

Rename the swap-submission planning op for symmetry with the exact-in/exact-out
split already applied to the quote ops (swap_exact_in_quote /
swap_exact_out_quote): swap_plan -> swap_exact_in_plan, SwapPlanRequest ->
SwapExactInPlanRequest, and the C export amm_swap_plan -> amm_swap_exact_in_plan
(cbindgen header regenerated). The module's swapExactInput call site and trace
are updated to match.
This commit is contained in:
r4bbit
2026-08-06 14:31:49 +02:00
parent d038b3d060
commit a389dc6056
7 changed files with 23 additions and 23 deletions
+4 -4
View File
@@ -609,9 +609,9 @@ std::string AmmModuleImpl::swapExactInput(const std::string& def_a_hex,
return {};
}
// amm_swap_plan resolves the pool, reorders holdings to the pool's canonical
// def order, encodes SwapExactInput, and returns a ready-to-submit plan.
const FfiResult planResult = call(amm_swap_plan, json{
// amm_swap_exact_in_plan resolves the pool, reorders holdings to the pool's
// canonical def order, encodes SwapExactInput, and returns a ready-to-submit plan.
const FfiResult planResult = call(amm_swap_exact_in_plan, json{
{"ammProgramId", net.amm_program_id},
{"tokenInId", def_a_hex},
{"tokenOutId", def_b_hex},
@@ -623,7 +623,7 @@ std::string AmmModuleImpl::swapExactInput(const std::string& def_a_hex,
{"deadlineMs", deadline_decimal},
});
if (!planResult.ok || jStr(planResult.value, "status") != "ready") {
AMM_TRACE("swapExactInput: FAIL amm_swap_plan not ready");
AMM_TRACE("swapExactInput: FAIL amm_swap_exact_in_plan not ready");
return {};
}
const json plan = planResult.value;