Skip to content

Conversation

pcarranzav
Copy link
Member

No description provided.

Copy link

vercel bot commented Jun 12, 2025

@pcarranzav is attempting to deploy a commit to the The Graph Foundation team on Vercel, but is not a member of this team. To resolve this issue, you can:

  • Make your repository public. Collaboration is free for open source and public repositories.
  • Add @pcarranzav as a member. A Pro subscription is required to access Vercel's collaborative features.
    • If you're the owner of the team, click here and add @pcarranzav as a member.
    • If you're the user who initiated this build request, click here to request access.
    • If you're already a member of the The Graph Foundation team, make sure that your Vercel account is connected to your GitHub account.

To read more about collaboration on Vercel, click here.

@pcarranzav pcarranzav force-pushed the pcv/smart-account branch 2 times, most recently from f1072bd to 8f2fa9d Compare June 20, 2025 14:15
@pcarranzav pcarranzav marked this pull request as ready for review June 23, 2025 17:03
await Connect.login({ walletClient, signer, syncServerUri, storage, identityToken, rpcUrl, chain: CHAIN });
},
[identityToken],
[identityToken, signMessage],
Copy link
Collaborator

@nikgraf nikgraf Jun 23, 2025

Choose a reason for hiding this comment

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

signMessage leads to infinite loops sometimes from my experience - would remove it from the dependency array

Copy link
Collaborator

@nikgraf nikgraf Jun 23, 2025

Choose a reason for hiding this comment

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

maybe it's fine - just saw I used it below as well, can you test that signup and logging in again works? then we can keep it

{
headers: {
'privy-id-token': identityToken,
'account-address': accountAddress,
Copy link
Collaborator

Choose a reason for hiding this comment

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

the accountAddress can be access in the backend based on the privy id token. Do we need to send it here?

Copy link
Member Author

Choose a reason for hiding this comment

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

it's not the same, the address in the privy id token is the owner wallet, which is different from the smart account address. We need to identify the user by the smart account address.

Copy link
Collaborator

Choose a reason for hiding this comment

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

ahhh ok

navigate({ to: '/', replace: true });
} catch (error) {
alert('Failed to login');
console.log('Failed to login');
Copy link
Collaborator

Choose a reason for hiding this comment

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

can we leave it at alert? otherwise users get no feedback in case it fails

Copy link
Member Author

Choose a reason for hiding this comment

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

yes, sorry, this was during testing, as it was annoying to debug with the alert

// Check that the signature is valid
const valid = await verifyMessage({
address: accountAddress as Hex,
address: (await signer.getAddress()) as Hex,
Copy link
Collaborator

Choose a reason for hiding this comment

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

is this the same address as the accountAddress? I need the account address to query e.g. list of public spaces the current account is a member of

Copy link
Member Author

Choose a reason for hiding this comment

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

no, as I mentioned above, the signer address is different from the account address. We have the account address in other places (it is deterministically generated from the owner address) so we don't need it in this function afaict.


export const encryptAppIdentity = async (
signer: Signer,
accountAddress: string,
Copy link
Collaborator

Choose a reason for hiding this comment

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

same as above, can I still access the accountAddress in the app then?

Copy link
Member Author

Choose a reason for hiding this comment

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

yes, getSmartAccountWalletClient will give you the smart account client, and then client.account.address is the accountAddress - you can see how we generate and store it in Connect.login

@nikgraf nikgraf merged commit 063c6af into main Jun 23, 2025
4 of 6 checks passed
@nikgraf nikgraf deleted the pcv/smart-account branch June 23, 2025 19:56
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