mirror of
https://github.com/logos-blockchain/lez-programs.git
synced 2026-08-25 06:01:11 +00:00
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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user