diff --git a/api/bin/chainflip-broker-api/src/main.rs b/api/bin/chainflip-broker-api/src/main.rs index fb574e0315..000f33562e 100644 --- a/api/bin/chainflip-broker-api/src/main.rs +++ b/api/bin/chainflip-broker-api/src/main.rs @@ -58,11 +58,11 @@ pub trait Rpc { destination_asset: Asset, destination_address: AddressString, broker_commission: BasisPoints, - retry_duration: u32, min_output_amount: NumberOrHex, - dca_parameters: Option, + retry_duration: u32, boost_fee: Option, affiliate_fees: Option>, + dca_parameters: Option, ) -> RpcResult; } @@ -116,7 +116,7 @@ impl RpcServer for RpcServerImpl { broker_commission, channel_metadata, boost_fee, - affiliate_fees.unwrap_or_default(), + affiliate_fees, refund_parameters, dca_parameters, ) @@ -143,11 +143,11 @@ impl RpcServer for RpcServerImpl { destination_asset: Asset, destination_address: AddressString, broker_commission: BasisPoints, - retry_duration: u32, min_output_amount: NumberOrHex, - dca_parameters: Option, + retry_duration: u32, boost_fee: Option, affiliate_fees: Option>, + dca_parameters: Option, ) -> RpcResult { Ok(self .api @@ -156,12 +156,12 @@ impl RpcServer for RpcServerImpl { source_asset, destination_asset, destination_address, - retry_duration, + broker_commission, try_parse_number_or_hex(min_output_amount).map_err(to_rpc_error)?, + retry_duration, boost_fee, - dca_parameters, - broker_commission, affiliate_fees, + dca_parameters, ) .await .map_err(to_rpc_error)?) diff --git a/api/lib/src/lib.rs b/api/lib/src/lib.rs index df0da8aa16..41a06ebb38 100644 --- a/api/lib/src/lib.rs +++ b/api/lib/src/lib.rs @@ -397,7 +397,7 @@ pub trait BrokerApi: SignedExtrinsicApi + StorageApi + Sized + Send + Sync + 'st broker_commission: BasisPoints, channel_metadata: Option, boost_fee: Option, - affiliate_fees: Affiliates, + affiliate_fees: Option>, refund_parameters: Option, dca_parameters: Option, ) -> Result { @@ -418,7 +418,7 @@ pub trait BrokerApi: SignedExtrinsicApi + StorageApi + Sized + Send + Sync + 'st broker_commission, channel_metadata, boost_fee: boost_fee.unwrap_or_default(), - affiliate_fees, + affiliate_fees: affiliate_fees.unwrap_or_default(), refund_parameters: refund_parameters .map(|rpc_params| { Ok::<_, anyhow::Error>(ChannelRefundParametersGeneric { @@ -526,15 +526,15 @@ pub trait BrokerApi: SignedExtrinsicApi + StorageApi + Sized + Send + Sync + 'st async fn request_swap_parameter_encoding( &self, - input_asset: Asset, - output_asset: Asset, - output_address: AddressString, - retry_duration: BlockNumber, + source_asset: Asset, + destination_asset: Asset, + destination_address: AddressString, + broker_commission: BasisPoints, min_output_amount: AssetAmount, + retry_duration: BlockNumber, boost_fee: Option, - dca_parameters: Option, - broker_commission: BasisPoints, affiliate_fees: Option>, + dca_parameters: Option, ) -> Result { // Check if safe mode is active let block_hash = self.base_rpc_api().latest_finalized_block_hash().await?; @@ -566,12 +566,12 @@ pub trait BrokerApi: SignedExtrinsicApi + StorageApi + Sized + Send + Sync + 'st } // Encode swap - match ForeignChain::from(input_asset) { + match ForeignChain::from(source_asset) { ForeignChain::Bitcoin => { let params = UtxoEncodedData { - output_asset, - output_address: output_address - .try_parse_to_encoded_address(output_asset.into())?, + output_asset: destination_asset, + output_address: destination_address + .try_parse_to_encoded_address(destination_asset.into())?, parameters: SharedCfParameters { retry_duration: retry_duration.try_into()?, min_output_amount,