-
Notifications
You must be signed in to change notification settings - Fork 58
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: tinkering with the quote flow
- Loading branch information
1 parent
4ee7f93
commit 34d7004
Showing
9 changed files
with
75 additions
and
108 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,6 +8,7 @@ | |
|
||
pub mod address; | ||
pub mod payment; | ||
pub mod quote; | ||
|
||
#[cfg(feature = "data")] | ||
pub mod archive; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,22 @@ | ||
use crate::common::Amount; | ||
use crate::contract::payment_vault::handler::PaymentVaultHandler; | ||
use crate::quoting_metrics::QuotingMetrics; | ||
use crate::utils::http_provider; | ||
use crate::Network; | ||
|
||
pub mod error; | ||
pub mod handler; | ||
pub mod implementation; | ||
pub mod interface; | ||
|
||
pub const MAX_TRANSFERS_PER_TRANSACTION: usize = 256; | ||
|
||
/// Helper function to return a quote for the given quoting metrics | ||
pub async fn get_quote( | ||
network: &Network, | ||
quoting_metrics: QuotingMetrics, | ||
) -> Result<Amount, error::Error> { | ||
let provider = http_provider(network.rpc_url().clone()); | ||
let payment_vault = PaymentVaultHandler::new(*network.data_payments_address(), provider); | ||
payment_vault.get_quote(quoting_metrics).await | ||
} |
Oops, something went wrong.