feat: Add protocol_specific_addresses.json file

This way we can define protocol and chain specific addresses in this file and use them in the Encoders

--- don't change below this line ---
ENG-4306 Took 1 hour 4 minutes
This commit is contained in:
Diana Carvalho
2025-04-08 09:29:38 +01:00
parent 913d677ffb
commit 739fb46d20
6 changed files with 370 additions and 215 deletions

View File

@@ -1,3 +1,5 @@
use std::collections::HashMap;
use crate::encoding::{
errors::EncodingError,
models::{Chain, EncodingContext, Swap},
@@ -11,7 +13,13 @@ pub trait SwapEncoder: Sync + Send {
/// # Arguments
/// * `executor_address` - The address of the contract that will execute the swap
/// * `chain` - The chain on which the swap will be executed
fn new(executor_address: String, chain: Chain) -> Result<Self, EncodingError>
/// * `config` - Additional configuration parameters for the encoder, like vault or registry
/// address
fn new(
executor_address: String,
chain: Chain,
config: Option<HashMap<String, String>>,
) -> Result<Self, EncodingError>
where
Self: Sized;