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

Implement Sargon HostInteractor #1447

Open
wants to merge 54 commits into
base: main
Choose a base branch
from

Conversation

matiasbzurovski
Copy link
Contributor

@matiasbzurovski matiasbzurovski commented Jan 24, 2025

Jira ticket: ABW-3853
Jira ticket: ABW-4133

Description

This PR implements Sargon's HostInteractor, which is required in order to make usage of the KeysCollector & SignaturesCollector inside Sargon. This allows us to delegate any operation that requires keys derivation/signatures into Sargon (e.g. Create an Account, Create a Persona, Sign a Transaction, etc).

Internally, Sargon will use the mentioned HostInteractor, that will just present the corresponding UI and either sign/derive the public keys for the corresponding input.

Pending items

Now that the DerivePublicKeys & Signing views are presented via the OverlayWindowClient, we need to update how these two views handle the errors. We cannot just do errorQueue.schedule(error), because the corresponding error alert wouldn't be presented until the current DerivePublicKeys/Signing view is dismissed (since they are all presented sequentially from the same list determined by the OverlayWindowClient). I still need to update the handling for them.

###Future updates
The FactorSourceAccess has been briefly updated for this PR, but the updates to handle new Factor Sources and contexts will be done in a future PR.

How to test

Try any flow that can require keys derivation or signatures and verify it works as expected 🙂

As a reference, I am adding below some example videos for different flows that are now handled via Sargon.

Example flows

  1. Create an Account using DeviceFactorSource. Video
  2. Make a transfer from a Ledger account to another account that was created using a different Ledger device and denies third party deposits. This means, two Ledger signatures required. Video
  3. Login to Anthic dApp and sign a subintent to swap XRD for xUSDT. Video
  4. Proof Onwership of a Ledger account. Video

@@ -1,505 +1,101 @@
import ComposableArchitecture
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I recommend just reviewing the new file rather than the diff for this reducer and its view

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

1 participant