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

[feat] Native privy auth #51

Merged
merged 5 commits into from
Oct 14, 2024
Merged

[feat] Native privy auth #51

merged 5 commits into from
Oct 14, 2024

Conversation

coffeexcoin
Copy link
Collaborator

@coffeexcoin coffeexcoin commented Oct 10, 2024

Adds a new AbstractPrivyProvider under @abstract-foundation/agw-react/privy
This provider can be used to wrap the application instead of AbstractWalletProvider if the hosting application is using Privy for their own authentication.

Also added is a convenience hook useAbstractPrivyLogin which allows for quick login/link of AGW account on the host application


PR-Codex overview

This PR focuses on integrating a new Privy wallet connector into the agw-react package, enhancing the login functionality and provider setup for abstract wallet connections.

Detailed summary

  • Added id: 'xyz.abs.privy' to the abstract wallet connector.
  • Exported AbstractPrivyProvider and useAbstractPrivyLogin in privy.ts.
  • Updated connector lookup in useLoginWithAbstract to use id.
  • Implemented InjectWagmiConnector for handling wallet connections.
  • Created AbstractPrivyProvider for configuring the Privy provider.
  • Introduced usePrivyCrossAppProvider for managing cross-app accounts.
  • Updated package.json to include @privy-io/react-auth dependency.

The following files were skipped due to too many changes: pnpm-lock.yaml

✨ Ask PR-Codex anything about this PR by commenting with /codex {your question}

@coffeexcoin coffeexcoin marked this pull request as ready for review October 10, 2024 17:56
@coffeexcoin coffeexcoin requested a review from cygaar as a code owner October 10, 2024 17:56
case 'eth_sendTransaction':
case 'eth_signTransaction':
// TODO: Implement
return randomBytes(32).toString('hex'); // fake tx hash
Copy link
Contributor

Choose a reason for hiding this comment

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

What is the implementation going to be here?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

tbd - currently only sendTransaction is exposed via cross app connect, not a signTransaction

This only applies to transactions from the underlying cross connect EOA, not the AGW

Copy link
Contributor

Choose a reason for hiding this comment

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

ah gotcha

case 'eth_sign':
throw new Error('eth_sign is unsafe and not supported');
case 'personal_sign': {
console.log(params);
Copy link
Contributor

Choose a reason for hiding this comment

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

Don't need this if you've verified it works

@coffeexcoin coffeexcoin merged commit ab774ae into main Oct 14, 2024
3 checks passed
@coffeexcoin coffeexcoin deleted the feat/native-privy branch October 14, 2024 12:28
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.

2 participants