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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
#### Added

- `sncast get nonce` command to get the nonce of a contract.
- `sncast get tx` command to get transaction details by hash.

### Forge

Expand Down
17 changes: 17 additions & 0 deletions crates/foundry-ui/src/styling.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
use console::style;
use starknet_types_core::felt::Felt;
use std::fmt::Write;

#[derive(Debug, Clone)]
Expand Down Expand Up @@ -88,6 +89,22 @@ impl OutputBuilder {
self
}

#[must_use]
pub fn padded_felt_field(self, label: &str, felt: &Felt) -> Self {
self.field(label, &felt.to_fixed_hex_string())
}

#[must_use]
pub fn felt_field(self, label: &str, felt: &Felt) -> Self {
self.field(label, &felt.to_hex_string())
}

#[must_use]
pub fn felt_list_field(self, label: &str, felts: &[Felt]) -> Self {
let felts = felts.iter().map(Felt::to_hex_string).collect::<Vec<_>>();
self.field(label, &format!("[{}]", felts.join(", ")))
}

#[must_use]
pub fn build(self) -> String {
let field_width = self.calculate_field_label_width();
Expand Down
1 change: 1 addition & 0 deletions crates/sncast/src/response/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ pub mod multicall;
pub mod nonce;
pub mod script;
pub mod show_config;
pub mod transaction;
pub mod transformed_call;
pub mod tx_status;
pub mod ui;
Expand Down
Loading
Loading