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

Release 2.0.0 FastAuthWallet version to BOS VM and NearDiscovery #249

Closed
Pessina opened this issue Jun 10, 2024 · 13 comments · Fixed by near/near-discovery#1247
Closed

Release 2.0.0 FastAuthWallet version to BOS VM and NearDiscovery #249

Pessina opened this issue Jun 10, 2024 · 13 comments · Fixed by near/near-discovery#1247
Assignees

Comments

@Pessina
Copy link
Collaborator

Pessina commented Jun 10, 2024

The current FastAuthWallet and FastAuthSigner support only signing delegate actions. This PR introduces new methods to enable FastAuthWallet and FastAuthSigner to sign and send transactions without using a relayer.

PR link: #26

New Methods:

  • signAndSendSignedDelegate
  • signAndSendTransaction

The interface of these new methods is consistent with the existing signAndSendTransaction.

Important Notes:

  • This release is a breaking change.
  • To access the new features, update to wallet version 2.0.0.
  • Post-merge, update BOS VM and Near Discovery to use the latest wallet version.
@Pessina Pessina changed the title Release 1.0.0 FastAuthWallet version to BOS VM and NearDiscovery Release 2.0.0 FastAuthWallet version to BOS VM and NearDiscovery Jun 12, 2024
@charleslavon
Copy link

charleslavon commented Jun 12, 2024

hey @Pessina can you help clarify what are the end goals as it relates to near-discovery and the relayer used by the vm?

@Pessina
Copy link
Collaborator Author

Pessina commented Jun 13, 2024

Hey @charleslavon ,

The previous version of the wallet was only able to sign DelegateAction and send them through the relayer. What imposed some limitations, like: only being able to call contracts and actions whitelisted/allowed by the relayer.

With this new version, the dApp have the option to choose if it wants to request a DelegateAction signature (gas paid by the relayer) or a Transaction signature (gas paid by the user).

For more details I pinged @esaminu, I think he knows more about the ecosystem and can explain it better than me.

@esaminu
Copy link
Collaborator

esaminu commented Jun 14, 2024

Hi @charleslavon to add to @Pessina 's explanation the end goal is to integrate the new signAndSendDelegateAction into the BOS and make it accessible to component developers. Currently only signAndSendTransaction is accessible to component devs through the following methods:

  1. Social.set
  2. Near.call
  3. CommitButton, I remember using this before but I don't see it in the docs anymore. Maybe it was deprecated?

We need to add similar methods or add additional arguments to these methods so that component developers can be more explicit and opt to send these transactions as meta transactions covered by the relayer and secondly we need to update the actions that intend to use the relayer in near-discovery-components e.g. the TOS component and DevHub components. Since BOS components support many wallets they will likely need to check if the wallet their user selected supports meta transactions before calling the new methods.

@geltonastech
Copy link

Just to understand. So people like me who created a wallet using email address at near.org still cannot withdraw funds right?

how to create a ticket for help in this regard? thanks in advance

@charleslavon
Copy link

hey @geltonastech this issue is a requisite to support allowing fast-auth accounts successfully sign arbitrary transactions like sending funds. This is being prioritized for attention. Keep an eye on this issue for progress updates. Thanks.

@charleslavon charleslavon assigned Pessina and unassigned Pessina Jul 2, 2024
@charleslavon
Copy link

@Pessina @esaminu for local development and testing of 2.1.0, what should I pass into setupFastAuthWallet({ walletUrl, iconUrl, deprecated, successUrl, failureUrl, relayerUrl, })

@Pessina
Copy link
Collaborator Author

Pessina commented Jul 3, 2024

@charleslavon for local development you have to provide the walletUrl. If the relayer it's failing too much, I also provide the relayerUrl.

In order to provide the walletUrl follow this steps:

Then you provide to walletUrl: http://localhost:3000 something like this.

Let me know if you face any issues, if it's better you can ping me on slack

@Pessina
Copy link
Collaborator Author

Pessina commented Jul 3, 2024

@charleslavon I'm sorry, I think I wasn't clear about the relayerUrl, you have to provide it.

In case the url setup on the main branch it's not working, then I provide a local relayerUrl

@charleslavon charleslavon self-assigned this Jul 8, 2024
@charleslavon
Copy link

@geltonastech See the instructions here

@geltonastech
Copy link

Lots of thanks charles ! I just solved the issue. thanks again you all for your time ))

@calebjacob calebjacob self-assigned this Jul 9, 2024
@calebjacob
Copy link

calebjacob commented Jul 9, 2024

Hey @esaminu, thanks for being willing to help me debug the relayer issues I mentioned in Slack. Getting everything running is going to be a bit of a chore because the changes need to be made in the VM layer, but here are the steps to follow in order:

  1. Clone or pull the latest changes for the gateway (on the develop branch): https://github.com/near/near-discovery
  2. Clone my fork of the VM repo and checkout the dev branch: https://github.com/calebjacob/VM/tree/dev
  3. Read this README section for the rest of the steps: https://github.com/near/near-discovery?tab=readme-ov-file#local-vm-development
  4. Open up the local gateway at localhost:3000 and sign in to any FastAuth account
  5. You should see our TOS modal pop up. Attempting to accept the TOS will trigger the 500 response from the relayer.
  6. Refresh the page to trigger the TOS modal again and repeat as needed.

Here's a quick Loom going over what I'm seeing: https://www.loom.com/share/c3a4e67b6c254fa298b9cbd76f5c55e6

@calebjacob
Copy link

@esaminu I forgot to mention where my relevant code changes are in my VM fork. Here's a screenshot (src/lib/data/commitData.js):

Screenshot 2024-07-09 at 3 54 28 PM

@calebjacob
Copy link

Hey @charleslavon, I've opened a PR to merge into the official VM repo here: NearSocial/VM#200

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

Successfully merging a pull request may close this issue.

5 participants