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(wallet): add Liquid Auth provider #215

Merged
merged 42 commits into from
Oct 20, 2024

Conversation

HashMapsData2Value
Copy link
Contributor

@HashMapsData2Value HashMapsData2Value commented Aug 14, 2024

Adds Liquid-Auth-Js (abstracted behind Liquid-Auth-Use-Wallet-Client, name open to change!), to allow for the demo Liquid Auth Android app to be used for demonstrative purposes. Similar to the Wallet Connect example wallet/provider.

Liquid Auth requires a backend-api which is included in this PR. Namely, the liquid-auth-backend examples folder. It comes with a docker compose yaml file with instructions on how to set things up using Ngrok to host the Liquid Auth backend and tunnel through to a URL accessible publicly provided by Ngrok.

The docker-compose also includes an Nginx container that, besides doing reverse proxy stuff, also hosts the static files generated the example frontends. By default it is the vanilla-ts that is hosted.


Examples:

  • vanilla-ts, vue-ts, react-ts and solid-ts: all of these work as expected
  • nextjs: Issues with server-side rendering
  • nuxt: haven't adjusted for lack of dist folder

@HashMapsData2Value HashMapsData2Value marked this pull request as draft September 2, 2024 02:06
@HashMapsData2Value HashMapsData2Value changed the title WIP: feat(wallet): Adds liquid-auth-js feat(wallet): Adds liquid-auth-js Sep 2, 2024
@HashMapsData2Value HashMapsData2Value changed the title feat(wallet): Adds liquid-auth-js feat(wallet): Adds Liquid 💧 as a wallet Sep 2, 2024
@HashMapsData2Value HashMapsData2Value marked this pull request as ready for review September 9, 2024 10:29
@HashMapsData2Value
Copy link
Contributor Author

HashMapsData2Value commented Sep 9, 2024

As mentioned privately, the BaseWallet's signTransaction method has an _indexesToSign argument. Because there are no examples I have not been sure how to best implement this.

The current implementation simply maps through the tx:s:

https://github.com/algorandfoundation/liquid-auth-use-wallet-client/blob/63eafc5477014aaf8c056c546f3ff076c51985b4/src/LiquidAuthClient.ts#L144

@drichar
Copy link
Collaborator

drichar commented Sep 10, 2024

The indexesToSign argument is optional and can be omitted when using signTransactions.

It exists as an optional "filter" only if you want to tell the wallet which specific transactions you want the user to sign.

Each transaction in the group is inspected and only marked for signature if:

  1. it is unsigned
  2. the signer account is currently active or connected
  3. indexesToSign is undefined, OR it contains the transaction's index

If any of those conditions are false then it will not be presented for signature.

@HashMapsData2Value
Copy link
Contributor Author

Hi @drichar, as we spoke on Discord it is optional and it's handled internally within the use-wallet-client repo so I believe it can be left to the side for now.

@drichar drichar changed the title feat(wallet): Adds Liquid 💧 as a wallet feat(wallet): add Liquid Auth provider Oct 20, 2024
@drichar drichar merged commit abf22d8 into TxnLab:main Oct 20, 2024
1 check passed
@HashMapsData2Value HashMapsData2Value deleted the feat/LiquidAuth-Provider branch October 21, 2024 07:13
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