-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1295 from rainlanguage/02/13/25-branched-add-orde…
…r-rush-function 02/13/25 Add_order.rs query for new deployments, and await new deployment as part of tx flow
- Loading branch information
Showing
14 changed files
with
596 additions
and
36 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
use cynic::Id; | ||
use rain_orderbook_bindings::wasm_traits::prelude::*; | ||
use rain_orderbook_subgraph_client::{OrderbookSubgraphClient, OrderbookSubgraphClientError}; | ||
use reqwest::Url; | ||
|
||
/// Internal function to fetch Add Orders for a given transaction | ||
/// Returns an array of AddOrder structs | ||
#[wasm_bindgen(js_name = "getTransactionAddOrders")] | ||
pub async fn get_transaction_add_orders( | ||
url: &str, | ||
tx_hash: &str, | ||
) -> Result<JsValue, OrderbookSubgraphClientError> { | ||
let client = OrderbookSubgraphClient::new(Url::parse(url)?); | ||
let add_orders = client.transaction_add_orders(Id::new(tx_hash)).await?; | ||
Ok(to_value(&add_orders)?) | ||
} |
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 |
---|---|---|
@@ -0,0 +1,16 @@ | ||
use super::common::{AddOrderWithOrder, Bytes}; | ||
use crate::schema; | ||
use typeshare::typeshare; | ||
|
||
#[derive(cynic::QueryVariables, Debug)] | ||
pub struct TransactionAddOrdersVariables { | ||
pub id: Bytes, | ||
} | ||
|
||
#[derive(cynic::QueryFragment, Debug)] | ||
#[cynic(graphql_type = "Query", variables = "TransactionAddOrdersVariables")] | ||
#[typeshare] | ||
pub struct TransactionAddOrdersQuery { | ||
#[arguments(where: { transaction_: { id: $id } })] | ||
pub add_orders: Vec<AddOrderWithOrder>, | ||
} |
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,3 +1,4 @@ | ||
pub mod add_order; | ||
pub mod common; | ||
mod impls; | ||
pub mod order; | ||
|
Oops, something went wrong.