From 80f1ca913b9ca74f6dd3739d9472533dcda59892 Mon Sep 17 00:00:00 2001 From: royvardhan Date: Wed, 5 Feb 2025 20:39:59 +0530 Subject: [PATCH] feat: default native action --- src/bin/lib/parse.rs | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/bin/lib/parse.rs b/src/bin/lib/parse.rs index 99f24cb..17f42f2 100644 --- a/src/bin/lib/parse.rs +++ b/src/bin/lib/parse.rs @@ -7,7 +7,7 @@ use tycho_core::{ dto::{Chain, ProtocolComponent}, Bytes, }; -use tycho_execution::encoding::models::{Solution, Swap}; +use tycho_execution::encoding::models::{NativeAction, Solution, Swap}; pub fn parse_solution(input: Value) -> Result> { let obj = input @@ -58,7 +58,15 @@ pub fn parse_solution(input: Value) -> Result Some(NativeAction::Wrap), + "unwrap" => Some(NativeAction::Unwrap), + _ => None, // Default to None + }) + .flatten(), direct_execution: obj .get("direct_execution") .and_then(|v| v.as_bool())