-
Notifications
You must be signed in to change notification settings - Fork 3
Register recovery agent from the signup service #349
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
Merged
gryaele
merged 14 commits into
main
from
elenagryaznova/pop-3692-register-recovery-agent-on-chain-from-signup-service
Apr 8, 2026
+150
−28
Merged
Changes from 6 commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
c2d9427
Register recovery agent from the signup service
gryaele ede2a44
Rename newRecoveryAgent to recoveryAgent
gryaele d40893d
Add register recovery binding command
gryaele 179ef39
Add sub and leaf index params
gryaele f17530f
Simplify bind recovery agent API
gryaele dd8ef28
Fix formatting
gryaele 0365933
Address clippy warnings
gryaele b8c36ea
Add recovery agent param to bind_recovery_agent method
gryaele 8f8e7de
Update walletkit-cli/src/commands/recovery_binding.rs
gryaele 13d8b4c
Update walletkit-core/src/issuers/recovery_bindings_manager.rs
gryaele 26a9650
Update walletkit-core/src/issuers/recovery_bindings_manager.rs
gryaele 2ecc7ee
Use alloy zero address
gryaele 7ffd951
Update walletkit-core/src/issuers/recovery_bindings_manager.rs
gryaele b5105b5
Take leaf index from the authenticat
gryaele File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,47 @@ | ||
| //! `walletkit recovery-agent` subcommands — recovery agent management. | ||
|
|
||
| use clap::Subcommand; | ||
|
|
||
| use super::{init_authenticator, Cli}; | ||
| use walletkit_core::issuers::RecoveryBindingManager; | ||
| use walletkit_core::Environment; | ||
|
|
||
| #[derive(Subcommand)] | ||
| pub enum RecoveryBindingCommand { | ||
| /// Register bindings for a recovery agent. | ||
| RegisterBindings { | ||
| leaf_index: u64, | ||
| /// Checksummed hex address of the recovery agent (e.g. "0x1234…"). | ||
| sub: String, | ||
| }, | ||
| UnregisterBindings { | ||
| leaf_index: u64, | ||
| sub: String, | ||
| }, | ||
| } | ||
|
|
||
| pub async fn run( | ||
| cli: &Cli, | ||
| action: &RecoveryBindingCommand, | ||
| environment: &Environment, | ||
| ) -> eyre::Result<()> { | ||
| let (authenticator, _store) = init_authenticator(cli).await?; | ||
|
|
||
| match action { | ||
| RecoveryBindingCommand::RegisterBindings { leaf_index, sub } => { | ||
| let recovery_binding_manager = | ||
| RecoveryBindingManager::new(environment).unwrap(); | ||
| recovery_binding_manager | ||
| .bind_recovery_agent(&authenticator, leaf_index.clone(), sub.clone()) | ||
| .await?; | ||
| } | ||
| RecoveryBindingCommand::UnregisterBindings { leaf_index, sub } => { | ||
| let recovery_binding_manager = | ||
| RecoveryBindingManager::new(environment).unwrap(); | ||
| recovery_binding_manager | ||
| .unbind_recovery_agent(&authenticator, *leaf_index, sub.clone()) | ||
| .await?; | ||
| } | ||
| } | ||
| Ok(()) | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.