feat: Create a EVMEncoderBuilder
- It has two three methods to be created: - new: where the user can pass any custom StrategyEncoder - tycho_router: where the default SplitSwapStrategyEncoder with Tycho Router will be used - direct_execution: where the user can encode only the execution data and integrate this into their workflow. - This replaces StrategyEncoderRegistry - EVMTychoEncoder holds directly the StrategyEncoder and not the registry (per one init of the EVMTychoEncoder there is only one possible StrategyEncoder) - Update quickstart - Update bin (add subcommands to bin to create a different instance of EVMEncoderBuilder) --- don't change below this line --- ENG-4246 Took 33 minutes Took 38 seconds Took 38 seconds
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
pub use clap::Parser;
|
||||
use clap::Subcommand;
|
||||
|
||||
#[derive(Parser)]
|
||||
/// Encode swap transactions for the Tycho router
|
||||
@@ -33,12 +34,24 @@ pub use clap::Parser;
|
||||
/// "direct_execution": false
|
||||
/// }
|
||||
/// ```
|
||||
#[command(author, version, about, long_about = None)]
|
||||
pub struct Cli {
|
||||
/// Private key for signing approvals (required when direct_execution is false)
|
||||
#[arg(short)]
|
||||
pub private_key: Option<String>,
|
||||
|
||||
/// Path to the executor addresses configuration file
|
||||
#[arg(short)]
|
||||
pub config_path: Option<String>,
|
||||
#[command(subcommand)]
|
||||
pub command: Commands,
|
||||
}
|
||||
|
||||
#[derive(Subcommand)]
|
||||
pub enum Commands {
|
||||
/// Use the Tycho router encoding strategy
|
||||
TychoRouter {
|
||||
#[arg(short, long)]
|
||||
config_path: Option<String>,
|
||||
#[arg(short, long)]
|
||||
private_key: String,
|
||||
},
|
||||
/// Use the direct execution encoding strategy
|
||||
DirectExecution {
|
||||
#[arg(short, long)]
|
||||
config_path: Option<String>,
|
||||
},
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user