Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
c91f4dd
feat: add "Withdraw all" buttons
brusherru Jul 16, 2025
b71489c
refactor: get rid of excessive arg `entity` in TransactionConfirmatio…
brusherru Jul 16, 2025
451ea05
feat: implement `generate_multicall_calldata`
brusherru Jul 17, 2025
39ca006
feat: integrate multiple vaults withdraw to order details page
brusherru Jul 17, 2025
14dba86
tweak: do not show "Withdraw all" button for vaults with 0 balance
brusherru Jul 17, 2025
8ea6431
feat: integrate withdraw all functionality on the Vaults page
brusherru Jul 17, 2025
cd18e96
tweak: improve displaying of withdrawal buttons on OrderDetails page
brusherru Jul 17, 2025
6bc4d85
tweak: improve GUI on Vaults list page
brusherru Jul 17, 2025
411f504
feat: integrate same functionality in Tauri-app
brusherru Jul 17, 2025
2c4e753
tweak: ensure that all vaults are in the same orderbook
brusherru Jul 17, 2025
3bed777
refactor: extract hardcoded `4` into `TRANSACTION_CONFIRMATIONS` cons…
brusherru Jul 17, 2025
72448db
tweak: enrich tooltip of disabled checkbox on Vaults page
brusherru Jul 17, 2025
b8dfd4c
tweak: invalidate all vaults after withdraw multiple vaults
brusherru Jul 17, 2025
9942056
fix: raise z-index of Tooltip
brusherru Jul 18, 2025
0ba07b5
fix: bring reactivity to showing/hiding "Withdraw all" buttons when w…
brusherru Jul 18, 2025
8884329
refactor: move `multicall` outside of `gui` module
brusherru Jul 18, 2025
7c81392
refactor: add input validation and tests for `generate_multicall_call…
brusherru Jul 19, 2025
c27fa21
refactor: re-use RaindexVaultType and extract VaultsGroupedByType
brusherru Jul 19, 2025
1acbb8c
tweak: drop vault selection only after signing tx
brusherru Jul 19, 2025
4e4886c
chore: update docs comment
brusherru Jul 19, 2025
011fbc0
refactor: bunch of tiny changes due to comments
brusherru Jul 19, 2025
fe996d4
chore: fix prettier
brusherru Jul 19, 2025
165893b
refactor: fix OrderDetail tests
brusherru Jul 20, 2025
2b93f42
fix: handle deseleting vaults on successfull withdraw properly in Tau…
brusherru Jul 20, 2025
80c8e4a
refactor: get rid of defaults for impossible undefined
brusherru Jul 20, 2025
8baac13
refactor: simplified reduce function as proposed
brusherru Jul 21, 2025
dec5a5b
chore: fix linting error
brusherru Jul 21, 2025
470e878
chore: update JSDoc
brusherru Jul 21, 2025
169f04a
fix: show hex-encoded vaultId on WithdrawAll modal
brusherru Jul 23, 2025
ebc38f3
chore: update JSDoc
brusherru Jul 23, 2025
65d0f25
refactor: get rid of excessive div nesting
brusherru Jul 23, 2025
757b707
tweak: add validation that all vaults belongs to the same orderbook
brusherru Jul 23, 2025
6e81edc
tweak: disable/enable checkbox on Vaults page reactively
brusherru Jul 24, 2025
591ac24
feat: add "Reset withdraw selection" button
brusherru Jul 24, 2025
c017ca0
feat: implement VaultsList struct
brusherru Jul 26, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions crates/common/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ pub mod types;
pub mod unit_tests;
pub mod utils;
pub mod withdraw;
pub mod withdraw_multiple;
pub use dotrain;
pub use dotrain_lsp;
#[cfg(test)]
Expand Down
1 change: 1 addition & 0 deletions crates/common/src/raindex_client/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ pub mod remove_orders;
pub mod trades;
pub mod transactions;
pub mod vaults;
pub mod vaults_list;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick (assertive)

Consider re-exporting VaultsList for a flatter public API

Down-stream crates / WASM consumers will now need to write raindex_client::vaults_list::VaultsList, whereas all other helpers are already exposed at the crate root (e.g. vaults).
Staying consistent keeps the TS/WASM surface intuitive.

 pub mod vaults_list;
+// Re-export for convenience and parity with `vaults::*`
+pub use vaults_list::VaultsList;
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
pub mod vaults_list;
pub mod vaults_list;
// Re-export for convenience and parity with `vaults::*`
pub use vaults_list::VaultsList;
🤖 Prompt for AI Agents
In crates/common/src/raindex_client/mod.rs at line 35, re-export the VaultsList
type or module at the crate root by adding a pub use statement for VaultsList
alongside the existing pub mod vaults_list. This will allow downstream crates
and WASM consumers to access VaultsList directly via raindex_client::VaultsList,
maintaining a consistent and flatter public API surface.


#[derive(Serialize, Deserialize, Debug, Clone, Tsify)]
pub struct ChainIds(#[tsify(type = "number[]")] pub Vec<u32>);
Expand Down
47 changes: 47 additions & 0 deletions crates/common/src/raindex_client/orders.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
use super::*;
use crate::raindex_client::vaults_list::VaultsList;
use crate::{
meta::TryDecodeRainlangSource,
raindex_client::{
Expand Down Expand Up @@ -139,6 +140,31 @@ impl RaindexOrder {
pub fn trades_count(&self) -> u16 {
self.trades_count
}

fn get_io_by_type(&self, vault_type: RaindexVaultType) -> Vec<RaindexVault> {
let vaults = self.vaults();
vaults
.iter()
.filter(|v| matches!(v.vault_type(), Some(vault_type)))
.cloned()
.collect()
}
#[wasm_bindgen(getter = vaultsList, unchecked_return_type = "VaultsList")]
pub fn vaults_list(&self) -> VaultsList {
VaultsList::new(self.vaults())
}
#[wasm_bindgen(getter = inputsList, unchecked_return_type = "VaultsList")]
pub fn inputs_list(&self) -> VaultsList {
VaultsList::new(self.get_io_by_type(RaindexVaultType::Input))
}
#[wasm_bindgen(getter = outputsList, unchecked_return_type = "VaultsList")]
pub fn outputs_list(&self) -> VaultsList {
VaultsList::new(self.get_io_by_type(RaindexVaultType::Output))
}
#[wasm_bindgen(getter = inputsOutputsList, unchecked_return_type = "VaultsList")]
pub fn inputs_outputs_list(&self) -> VaultsList {
VaultsList::new(self.get_io_by_type(RaindexVaultType::InputOutput))
}
}
#[cfg(not(target_family = "wasm"))]
impl RaindexOrder {
Expand Down Expand Up @@ -187,6 +213,27 @@ impl RaindexOrder {
pub fn trades_count(&self) -> u16 {
self.trades_count
}

fn get_io_by_type(&self, vault_type: RaindexVaultType) -> Vec<RaindexVault> {
let vaults = self.vaults();
vaults
.iter()
.filter(|v| matches!(v.vault_type(), Some(vault_type)))
.cloned()
.collect()
}
pub fn vaults_list(&self) -> VaultsList {
VaultsList::new(self.vaults())
}
pub fn inputs_list(&self) -> VaultsList {
VaultsList::new(self.get_io_by_type(RaindexVaultType::Input))
}
pub fn outputs_list(&self) -> VaultsList {
VaultsList::new(self.get_io_by_type(RaindexVaultType::Output))
}
pub fn inputs_outputs_list(&self) -> VaultsList {
VaultsList::new(self.get_io_by_type(RaindexVaultType::InputOutput))
}
}

fn get_vaults_with_type(
Expand Down
Loading
Loading