Skip to content
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

[Feature] Add AnyNetwork #272

Closed
onbjerg opened this issue Mar 11, 2024 · 1 comment
Closed

[Feature] Add AnyNetwork #272

onbjerg opened this issue Mar 11, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@onbjerg
Copy link
Member

onbjerg commented Mar 11, 2024

Component

network, json-rpc

Describe the feature you would like

Some applications might not know their network ahead of type (e.g. Foundry), so a catch-all network should be added (AnyNetwork) that essentially just returns the regular Ethereum types + a catch all field.

An idea would be to add a wrapper type like:

#[derive(Serialize, Deserialize)]
struct Extra<T> {
  #[serde(flatten)]
  object: T,
  #[serde(other)]
  other: BTreeMap<String, serde_json::Value>
}

with Deref/DerefMut implemented as well to make the wrapper transparent-ish

Additional context

No response

@onbjerg onbjerg added the enhancement New feature or request label Mar 11, 2024
@onbjerg
Copy link
Member Author

onbjerg commented Mar 12, 2024

Dupe of #81

@onbjerg onbjerg closed this as completed Mar 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant