-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add initial thorchain implementation #300
Conversation
} | ||
|
||
#[derive(Debug, Clone, Serialize, Deserialize)] | ||
pub struct QuoteFees {} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what is struct used for?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need to return total fees into the result quote
request.clone().from_asset, | ||
request.to_asset.clone(), | ||
value.to_string(), | ||
"g1".to_string(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's add a constant for this g1
@@ -15,6 +15,11 @@ impl BigNumberFormatter { | |||
let decimal = Self::big_decimal_value(value, decimals as u32)?; | |||
Some(decimal.to_string()) | |||
} | |||
|
|||
pub fn divide(value: &str, decimals: u32) -> String { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe pass in BigInt instead of str, then we can handle unwrap outside
} | ||
|
||
async fn fetch_quote_data(&self, quote: &SwapQuote, _provider: Arc<dyn AlienProvider>, _data: FetchQuoteData) -> Result<SwapQuoteData, SwapperError> { | ||
let memo = ThorChainSwapClient::get_memo(quote.request.to_asset.clone(), quote.request.destination_address.clone(), "g1".to_string(), 50).unwrap(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
g1
can be a constant
provider: SwapProviderData { | ||
name: self.name().to_string(), | ||
routes: vec![SwapRoute { | ||
route_type: quote.inbound_address.unwrap_or_default(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks like we need route_type data?, route_type is "thorchain" and route type data is "inbound address", so we can move fee_tier
and gas_estimate
to another type data for uniswap v3
No description provided.