-
Notifications
You must be signed in to change notification settings - Fork 236
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
feat: wallet namespace types #1448
Conversation
Signed-off-by: nadtech-hub <taberlick@gmail.com>
Signed-off-by: nadtech-hub <taberlick@gmail.com>
Signed-off-by: nadtech-hub <taberlick@gmail.com>
Signed-off-by: nadtech-hub <taberlick@gmail.com>
Signed-off-by: nadtech-hub <taberlick@gmail.com>
673909f
to
b93ff61
Compare
May I deliver other wallet types in separate pull requests? |
Signed-off-by: nadtech-hub <taberlick@gmail.com>
I didn't implement struct's getters / setters as long as their properties are made public |
/// Response type for RPC call. | ||
/// | ||
/// See [EIP-5792](https://eips.ethereum.org/EIPS/eip-5792#wallet_getcapabilities) | ||
pub type GetCapabilitiesResult = HashMap<ChainId, HashMap<String, PermissionValue>>; | ||
|
||
/// Response type of wallet_sendCalls | ||
pub type SendCallsResult = String; | ||
|
||
/// Request params of RPC call wallet_getCapabilities | ||
pub type GetCapabilitiesParams = Vec<Address>; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we use a copy of these types here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please remove these aliases, these are not very useful
Signed-off-by: nadtech-hub <taberlick@gmail.com>
0316af9
to
e651a5c
Compare
crates/rpc-types-wallet/Cargo.toml
Outdated
@@ -0,0 +1,29 @@ | |||
[package] | |||
name = "wallet-rpc-types" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
name = "wallet-rpc-types" | |
name = "alloy-wallet-rpc-types" |
pub calls: Vec<CallParams>, | ||
/// Enabled permissions per chain | ||
#[cfg_attr(feature = "serde", serde(default, skip_serializing_if = "Option::is_none"))] | ||
pub capabilities: Option<HashMap<String, PermissionValue>> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we can just use serde value here and remove the permissionValue
/// Response type for RPC call. | ||
/// | ||
/// See [EIP-5792](https://eips.ethereum.org/EIPS/eip-5792#wallet_getcapabilities) | ||
pub type GetCapabilitiesResult = HashMap<ChainId, HashMap<String, PermissionValue>>; | ||
|
||
/// Response type of wallet_sendCalls | ||
pub type SendCallsResult = String; | ||
|
||
/// Request params of RPC call wallet_getCapabilities | ||
pub type GetCapabilitiesParams = Vec<Address>; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please remove these aliases, these are not very useful
Signed-off-by: nadtech-hub <taberlick@gmail.com>
Motivation
Should close #1420
Solution
Added response type of wallet_getCapabilities call.
PR Checklist