Skip to content

[not fully tested] Wh/wallet signer #143

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 40 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
a232036
cleaned up commits
Hallmane Mar 26, 2025
860c2b4
Format Rust code using rustfmt
github-actions[bot] Mar 26, 2025
ba0d7c8
base tx works
Hallmane Mar 28, 2025
397a77c
f5
Hallmane Apr 1, 2025
e4fd3e6
er20_X works
Hallmane Apr 1, 2025
13b47f0
token address resolution
Hallmane Apr 1, 2025
517056e
bla
Hallmane Apr 2, 2025
063e805
merged latest main
Hallmane Apr 2, 2025
0aad3c8
removed cursor shit
Hallmane Apr 3, 2025
98e5aad
untested stuff that i've used in gotland wallet app
Hallmane Apr 8, 2025
f51e27a
merged main into wh/wallet-signer
Hallmane Apr 8, 2025
cace061
Format Rust code using rustfmt
github-actions[bot] Apr 8, 2025
8159f2d
removed eth_utils
Hallmane Apr 8, 2025
78e58f8
Merge branch 'wh/wallet-signer' of github.com:hyperware-ai/process_li…
Hallmane Apr 8, 2025
98a012d
removed non-existing eth_utils dependency from lib.rs
Hallmane Apr 8, 2025
8281514
proxy execute w tba wip
Hallmane Apr 30, 2025
a235fe8
Format Rust code using rustfmt
github-actions[bot] Apr 30, 2025
a237fad
access-list getter
Hallmane Apr 30, 2025
04ad71f
Merge branch 'wh/wallet-signer' of github.com:hyperware-ai/process_li…
Hallmane Apr 30, 2025
09d0e56
Format Rust code using rustfmt
github-actions[bot] Apr 30, 2025
2393f6e
added erc6551 5 call method w gas param
Hallmane May 1, 2025
17627e1
Format Rust code using rustfmt
github-actions[bot] May 1, 2025
20c1f80
merged new hypermap cacher into wh/wallet-signer
Hallmane Jun 3, 2025
8e90e36
Format Rust code using rustfmt
github-actions[bot] Jun 3, 2025
3fa844f
Merge branch 'main' into wh/wallet-signer
Hallmane Jun 9, 2025
cfb8d2b
4337 wip
Hallmane Jul 9, 2025
49638ca
Format Rust code using rustfmt
github-actions[bot] Jul 9, 2025
c9edb5f
gas from ZERO to something
Hallmane Jul 10, 2025
08a6dd3
v0.8.0 entrypoint
Hallmane Jul 10, 2025
38ed079
v0.8.0 structs...
Hallmane Jul 10, 2025
ae41238
Format Rust code using rustfmt
github-actions[bot] Jul 10, 2025
9bb25e5
wip
Hallmane Jul 10, 2025
d1a0815
Merge branch 'wh/wallet-signer' of github.com:hyperware-ai/process_li…
Hallmane Jul 10, 2025
ce71719
wup
Hallmane Jul 10, 2025
12843be
wip
Hallmane Jul 10, 2025
aa42c9f
Format Rust code using rustfmt
github-actions[bot] Jul 10, 2025
4658f09
wip
Hallmane Jul 10, 2025
daf3d17
wipwip
Hallmane Jul 10, 2025
140f94b
blawpi
Hallmane Jul 10, 2025
9f445a5
Format Rust code using rustfmt
github-actions[bot] Jul 10, 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
Binary file added .DS_Store
Binary file not shown.
194 changes: 125 additions & 69 deletions Cargo.lock

Large diffs are not rendered by default.

6 changes: 6 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,13 @@ alloy = { version = "0.8.1", features = [
"json-rpc",
"rpc-client",
"rpc-types",
"signers",
"signer-local",
"consensus",
"network",
] }
hex = "0.4.3"
sha3 = "0.10.8"
anyhow = "1.0"
base64 = "0.22.1"
bincode = "1.3.3"
Expand Down
Binary file added src/.DS_Store
Binary file not shown.
50 changes: 42 additions & 8 deletions src/eth.rs
Original file line number Diff line number Diff line change
Expand Up @@ -306,8 +306,8 @@ impl<'de> Deserialize<'de> for NodeOrRpcUrl {
/// for that chain.
#[derive(Clone, Debug, Deserialize, Serialize)]
pub struct Provider {
chain_id: u64,
request_timeout: u64,
pub chain_id: u64,
pub request_timeout: u64,
}

impl Provider {
Expand Down Expand Up @@ -761,21 +761,55 @@ impl Provider {
print_verbosity_success: u8,
print_verbosity_error: u8,
) {
let mut delay_secs = 5; // Initial delay
const MAX_DELAY_SECS: u64 = 60; // Maximum delay

loop {
match self.subscribe(sub_id, filter.clone()) {
Ok(()) => break,
Err(_) => {
Ok(()) => break, // Success, exit loop
Err(e) => {
// Log the actual error
crate::print_to_terminal(
print_verbosity_error,
"failed to subscribe to chain! trying again in 5s...",
&format!(
"Failed to subscribe to chain (sub_id {}): {:?}. Retrying in {}s...",
sub_id, e, delay_secs
),
);
std::thread::sleep(std::time::Duration::from_secs(5));
continue;
std::thread::sleep(std::time::Duration::from_secs(delay_secs));
// Increase delay for next attempt, capped at maximum
delay_secs = (delay_secs * 2).min(MAX_DELAY_SECS);
continue; // Retry
}
}
}
crate::print_to_terminal(print_verbosity_success, "subscribed to logs successfully");
crate::print_to_terminal(
print_verbosity_success,
&format!("Subscribed successfully (sub_id {})", sub_id),
);
}
//pub fn subscribe_loop(
// &self,
// sub_id: u64,
// filter: Filter,
// print_verbosity_success: u8,
// print_verbosity_error: u8,
//) {
// loop {
// match self.subscribe(sub_id, filter.clone()) {
// Ok(()) => break,
// Err(_) => {
// crate::print_to_terminal(
// print_verbosity_error,
// "failed to subscribe to chain! trying again in 5s...",
// );
// std::thread::sleep(std::time::Duration::from_secs(5));
// continue;
// }
// }
// }
// crate::print_to_terminal(print_verbosity_success, "subscribed to logs successfully");
//}

/// Unsubscribes from a previously created subscription.
///
Expand Down
8 changes: 6 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@ wit_bindgen::generate!({

/// Interact with the eth provider module.
pub mod eth;
/// Interact with the system homepage.
///
/// Your process must have the [`Capability`] to message
/// `homepage:homepage:sys` to use this module.
pub mod homepage;
Expand All @@ -41,6 +39,8 @@ pub mod hypermap;
/// be incompatible with WIT types in some cases, leading to annoying errors.
/// Use only to interact with the kernel or runtime in certain ways.
pub mod kernel_types;
/// Tools for exploring and working with Token-Bound Accounts (TBAs) in Hypermap
//pub mod tba_explorer;
/// Interact with the key_value module
///
/// Your process must have the [`Capability`] to message and receive messages from
Expand All @@ -55,6 +55,8 @@ pub mod logging;
/// `net:distro:sys` to use this module.
pub mod net;
pub mod sign;
/// Low-level Ethereum signing operations and key management.
pub mod signer;
/// Interact with the sqlite module
///
/// Your process must have the [`Capability] to message and receive messages from
Expand All @@ -69,6 +71,8 @@ pub mod timer;
/// Your process must have the [`Capability`] to message and receive messages from
/// `vfs:distro:sys` to use this module.
pub mod vfs;
/// Ethereum wallet management with transaction preparation and submission.
pub mod wallet;

/// A set of types and macros for writing "script" processes.
pub mod scripting;
Expand Down
Loading