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

Add SECP256k1 Authenticator #78

Merged
merged 20 commits into from
Feb 26, 2024
Merged

Add SECP256k1 Authenticator #78

merged 20 commits into from
Feb 26, 2024

Conversation

BurntVal
Copy link
Contributor

@BurntVal BurntVal commented Feb 9, 2024

This PR aims to introduce the ability to add a secp256k1 authenticator (via Keplr) and use it as a signer for transactions.

Although this functionally works, there are some points of consideration for the future, most in the form of "TODO" comments throughout the code, for instance in the useAbstraxionSigningClient hook. These can all be implemented as we scale towards multiple authenticators

Copy link

changeset-bot bot commented Feb 9, 2024

🦋 Changeset detected

Latest commit: 5f28fb9

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 6 packages
Name Type
abstraxion-dashboard Minor
@burnt-labs/signers Minor
@burnt-labs/ui Minor
demo-app Patch
@burnt-labs/abstraxion-core Patch
@burnt-labs/abstraxion Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link

vercel bot commented Feb 9, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
xion-js-abstraxion-dashboard ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 23, 2024 9:10pm
xion-js-demo-app ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 23, 2024 9:10pm

@justinbarry
Copy link
Contributor

Add ability to create accounts with Keplr as the first auth method.

@BurntVal
Copy link
Contributor Author

Added this message for users in the case of Keplr login with no SCAs found

Screenshot 2024-02-19 at 2 05 02 PM

@@ -35,33 +46,25 @@ export const useAbstraxionAccount = () => {
const refreshConnectionType = () => {
if (session) {
setConnectionType("stytch");
} else if (data) {
} else if (isConnected) {
// Is this the right conditional

Choose a reason for hiding this comment

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

is this still an open question?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This gets cleaned up in the eth authenticator PR, but this does work for this PR

? decodeJwt(session_jwt)
: { aud: undefined, sub: undefined };

// TODO: More robust

Choose a reason for hiding this comment

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

what is the robustness issue here?

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 might've just forgotten to delete this comment


const jwtClient = await AAClient.connectWithSigner(
if (!signer) {
// TODO: More robust edge handling

Choose a reason for hiding this comment

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

anything we can do here? at least log?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yea we can log, the worst case is that the transactions just fail

}

// Always returning the first one found because this query should only return an array of 1
return (

Choose a reason for hiding this comment

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

can we log when this isn't 1, since it is unexpected behavior

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 might actually be able to change the query so that it doesn't return an array, but if I can't then I'll just log this out

@ash-burnt ash-burnt merged commit 6de3996 into main Feb 26, 2024
3 checks passed
@ash-burnt ash-burnt deleted the feat/add-authenticators branch February 26, 2024 19:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants