-
Notifications
You must be signed in to change notification settings - Fork 4
feat: Add Move Authenticator support #442
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
DaughterOfMars
wants to merge
38
commits into
develop
Choose a base branch
from
feat/move-auth
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
38 commits
Select commit
Hold shift + click to select a range
7af3d89
feat: Add Move Authenticator support
DaughterOfMars 171e915
cleanup
DaughterOfMars e6d3857
improvements
DaughterOfMars 5cfd1e5
rename signature schemes
DaughterOfMars 56cf83b
build bindings
DaughterOfMars 2f40ea7
Add bindings fns
DaughterOfMars 9e74ab7
clippy
DaughterOfMars 0156060
fix tests
DaughterOfMars c6cce0f
use Vec<String> for type args
DaughterOfMars d38ae8e
fix features
DaughterOfMars 96b5b61
another one
DaughterOfMars 6066a06
update bindings
DaughterOfMars 8ceee72
add more suffixes
DaughterOfMars 97d69ea
refactor flow
DaughterOfMars fabaab7
tiny cleanup
DaughterOfMars 72033cb
delete example for now
DaughterOfMars a39b9c8
fmt
DaughterOfMars 496e142
expect with message
DaughterOfMars 917af55
Merge branch 'develop' into feat/move-auth
DaughterOfMars e610c0d
bindings
DaughterOfMars 48cab0d
remove error
DaughterOfMars f0eeff8
Merge branch 'develop' into feat/move-auth
thibault-martinez 70967ae
verifier variables name consistency
thibault-martinez 2facb0c
remove "new" from doc
thibault-martinez 2242ed2
Merge branch 'develop' into feat/move-auth
thibault-martinez ff38492
doc nit
thibault-martinez 6da4116
Merge branch 'develop' into feat/move-auth
thibault-martinez e9b223d
add move-auth-flag to doc
thibault-martinez a11b66e
remove outdated commented tests
thibault-martinez 5dd9fa1
rename to new_shared
thibault-martinez d02b502
remove MoveAuthenticator::new
thibault-martinez e87ee41
MoveAuthenticatorArgs
thibault-martinez f2ed2dc
remove mutable getters
thibault-martinez e54bd5e
make it work
thibault-martinez b4d9c10
clean the example
thibault-martinez 7b79e05
Add InvalidMoveAuthAccount
thibault-martinez ba342b1
undo a rename
thibault-martinez 330fb8a
MoveAuthenticator cleanup
thibault-martinez 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
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
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
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
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
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
80 changes: 80 additions & 0 deletions
80
crates/iota-sdk-ffi/src/types/crypto/move_authenticator.rs
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,80 @@ | ||
| // Copyright (c) 2025 IOTA Stiftung | ||
| // SPDX-License-Identifier: Apache-2.0 | ||
|
|
||
| use std::sync::Arc; | ||
|
|
||
| use crate::types::{ | ||
| address::Address, | ||
| digest::Digest, | ||
| object::{ObjectId, ObjectReference}, | ||
| transaction::Input, | ||
| type_tag::TypeTag, | ||
| }; | ||
|
|
||
| /// MoveAuthenticator is a signature variant that enables a method of | ||
| /// authentication through Move code. This function represents the data received | ||
| /// by the Move authenticate function during the Account Abstraction | ||
| /// authentication flow. | ||
| #[derive(derive_more::From, uniffi::Object)] | ||
| pub struct MoveAuthenticator(pub iota_sdk::types::MoveAuthenticator); | ||
|
|
||
| #[uniffi::export] | ||
| impl MoveAuthenticator { | ||
| /// Create a new move authenticator from an immutable object. | ||
| #[uniffi::constructor] | ||
| pub fn new_immutable( | ||
| call_args: Vec<Arc<Input>>, | ||
| type_args: Vec<Arc<TypeTag>>, | ||
| object_to_authenticate: ObjectReference, | ||
| ) -> Self { | ||
| Self(iota_sdk::types::MoveAuthenticator::new_immutable( | ||
| call_args.into_iter().map(|v| v.0.clone()).collect(), | ||
| type_args.into_iter().map(|v| v.0.clone()).collect(), | ||
| object_to_authenticate.into(), | ||
| )) | ||
| } | ||
|
|
||
| /// Create a new move authenticator from a shared object. | ||
| #[uniffi::constructor] | ||
| pub fn new_shared( | ||
| call_args: Vec<Arc<Input>>, | ||
| type_args: Vec<Arc<TypeTag>>, | ||
| object_to_authenticate: &ObjectId, | ||
| initial_shared_version: u64, | ||
| ) -> Self { | ||
| Self(iota_sdk::types::MoveAuthenticator::new_shared( | ||
| call_args.into_iter().map(|v| v.0.clone()).collect(), | ||
| type_args.into_iter().map(|v| v.0.clone()).collect(), | ||
| **object_to_authenticate, | ||
| initial_shared_version, | ||
| )) | ||
| } | ||
|
|
||
| pub fn address(&self) -> Address { | ||
| self.0.address().into() | ||
| } | ||
|
|
||
| pub fn call_args(&self) -> Vec<Arc<Input>> { | ||
| self.0 | ||
| .call_args() | ||
| .iter() | ||
| .cloned() | ||
| .map(Into::into) | ||
| .map(Arc::new) | ||
| .collect() | ||
| } | ||
|
|
||
| pub fn type_args(&self) -> Vec<Arc<TypeTag>> { | ||
| self.0 | ||
| .type_args() | ||
| .iter() | ||
| .cloned() | ||
| .map(Into::into) | ||
| .map(Arc::new) | ||
| .collect() | ||
| } | ||
|
|
||
| pub fn object_to_authenticate(&self) -> Input { | ||
| self.0.object_to_authenticate().clone().into() | ||
| } | ||
| } |
Oops, something went wrong.
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.