-
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 branch 'main' into 2025-02-18-rm-typeshare
- Loading branch information
Showing
28 changed files
with
378 additions
and
30 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 |
---|---|---|
@@ -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 Remove Orders for a given transaction | ||
/// Returns an array of RemoveOrder structs | ||
#[wasm_bindgen(js_name = "getTransactionRemoveOrders")] | ||
pub async fn get_transaction_remove_orders( | ||
url: &str, | ||
tx_hash: &str, | ||
) -> Result<JsValue, OrderbookSubgraphClientError> { | ||
let client = OrderbookSubgraphClient::new(Url::parse(url)?); | ||
let remove_orders = client.transaction_remove_orders(Id::new(tx_hash)).await?; | ||
Ok(to_value(&remove_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
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 |
---|---|---|
|
@@ -827,6 +827,7 @@ mod test { | |
meta: None, | ||
add_events: vec![], | ||
trades: vec![], | ||
remove_events: vec![], | ||
} | ||
} | ||
|
||
|
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 |
---|---|---|
@@ -0,0 +1,16 @@ | ||
use super::common::{Bytes, RemoveOrderWithOrder}; | ||
use crate::schema; | ||
use typeshare::typeshare; | ||
|
||
#[derive(cynic::QueryVariables, Debug)] | ||
pub struct TransactionRemoveOrdersVariables { | ||
pub id: Bytes, | ||
} | ||
|
||
#[derive(cynic::QueryFragment, Debug)] | ||
#[cynic(graphql_type = "Query", variables = "TransactionRemoveOrdersVariables")] | ||
#[typeshare] | ||
pub struct TransactionRemoveOrdersQuery { | ||
#[arguments(where: { transaction_: { id: $id } })] | ||
pub remove_orders: Vec<RemoveOrderWithOrder>, | ||
} |
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 |
---|---|---|
|
@@ -352,7 +352,8 @@ const mockAddOrder: SgAddOrderWithOrder = { | |
} | ||
} | ||
], | ||
trades: [] | ||
trades: [], | ||
removeEvents: [] | ||
} | ||
}; | ||
|
||
|
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
Oops, something went wrong.