Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion crates/js_api/src/gui/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ use wasm_bindgen_utils::{impl_wasm_traits, prelude::*, wasm_export};

mod deposits;
mod field_values;
mod order_operations;
pub mod order_operations;
Copy link
Contributor

Choose a reason for hiding this comment

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

🧹 Nitpick | 🔵 Trivial

Consider whether exposing the entire module is intentional.

Making order_operations public exposes all pub items within it — not just DeploymentTransactionArgs, but also CalldataFunction, VaultAndDeposit, TokenAllowance, and all the calldata result types. If the goal is only to expose DeploymentTransactionArgs and its related types for downstream consumers, a narrower approach would be to re-export specific items from mod.rs:

mod order_operations;
pub use order_operations::{DeploymentTransactionArgs, ExtendedApprovalCalldata, ExternalCall};

If full module exposure is intended for the downstream REST API, then the current approach is fine.

🤖 Prompt for AI Agents
In `@crates/js_api/src/gui/mod.rs` at line 39, The current pub mod
order_operations; exposes every public item in that module (e.g.,
DeploymentTransactionArgs, CalldataFunction, VaultAndDeposit, TokenAllowance,
and all calldata result types); if you only intend to expose
DeploymentTransactionArgs and a few related types, make the module private
(remove the pub) and re-export only the needed symbols from this file via pub
use order_operations::{DeploymentTransactionArgs, ExtendedApprovalCalldata,
ExternalCall} (adjust names to the exact types you need) so downstream consumers
only see the intended API; if full exposure was intended, keep the pub mod
as-is.

mod select_tokens;
mod state_management;
mod validation;
Expand Down
10 changes: 5 additions & 5 deletions crates/js_api/src/gui/order_operations.rs
Original file line number Diff line number Diff line change
Expand Up @@ -97,14 +97,14 @@ impl_wasm_traits!(ExternalCall);
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Tsify)]
#[serde(rename_all = "camelCase")]
pub struct DeploymentTransactionArgs {
approvals: Vec<ExtendedApprovalCalldata>,
pub approvals: Vec<ExtendedApprovalCalldata>,
#[tsify(type = "string")]
deployment_calldata: Bytes,
pub deployment_calldata: Bytes,
#[tsify(type = "string")]
orderbook_address: Address,
chain_id: u32,
pub orderbook_address: Address,
pub chain_id: u32,
#[tsify(type = "ExternalCall | undefined")]
emit_meta_call: Option<ExternalCall>,
pub emit_meta_call: Option<ExternalCall>,
}
impl_wasm_traits!(DeploymentTransactionArgs);

Expand Down