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 Trezor Wallet connection #11

Open
earrietadev opened this issue Jan 11, 2024 · 10 comments
Open

Add Trezor Wallet connection #11

earrietadev opened this issue Jan 11, 2024 · 10 comments
Assignees
Labels
good first issue Good for newcomers ODHack

Comments

@earrietadev
Copy link
Contributor

No description provided.

@earrietadev earrietadev added the good first issue Good for newcomers label Jun 12, 2024
@NueloSE
Copy link

NueloSE commented Jun 19, 2024

@earrietadev can I be assigned this task

@lauchaves
Copy link

Hey @earrietadev ! I'm Lau Chaves, I would like to contribute on this one!
I think this might take me 2-5 days to completed.
I have over 5 years of experience working with react,ts... this is my first OD Hack! So I'm pretty excited about it!

here's my onlydust profile https://app.onlydust.com/u/lauchaves not so much there since I'm starting in this world but here's my git as well https://github.com/lauchaves

@lauchaves
Copy link

Hey! @earrietadev, I'll give you a heads-up if I come across any issues. Thanks!

@ktarun1419
Copy link

Hi @earrietadev i want to work on this issue

@lauchaves
Copy link

lauchaves commented Jun 24, 2024

@earrietadev hey 👋 ! I have a couple of questions...

Regarding the signTx method, I noticed that the Trezor wallet's signTransaction method requires specifying a coin. Do we need to specify one? In my review of other wallet integrations, they do not require specifying a coin, and also that method doesn’t have a transaction parameter for the transaction: params.xdr like the other wallets.

Additionally, I found another Trezor method called stellarSignTransaction, which accepts a transaction directly instead of an XDR string,

the transaction for stellar approach should be something like this:
image
which is close to what is intended but no the same, idk if there's a way to decode the XDR

Given this, do we need to refactor our approach to match any of those methods?

Lastly, I tried to run the Stellar Wallet Kits on a simple project but had no luck. Is there a specific Node.js or TypeScript version required? I encountered errors related to TypeScript and ESM. Even after installing the necessary packages, it still didn't work. Is there another workaround to get it running, or might I be missing something? I followed the steps in the README.

btw is there a Discord or Telegram group chat for support, or is it okay to ask questions here on GitHub? 😄

@earrietadev
Copy link
Contributor Author

Hi @lauchaves it's ok to ask questions here,

I encountered errors related to TypeScript and ESM

You can try with the latest version, the kit is intended to be used in ES Module environment but I've seen some users asking for it to work on CommonJS workspaces too so I added the support for that.

Additionally, I found another Trezor method called stellarSignTransaction, which accepts a transaction directly instead of an XDR string

Most likely this will be the approach, and yeah Trezor requires the XDR to be parsed in their own way. You will need to include the Stellar SDK library into the kit and decode the XDR into a Stellar Transaction so you can then parse it in the way Trezor requires it.

Also, make sure to use the extended versions of the Trezor libraries... That's where they put all the utils when handling Stellar transactions (not sure why but the Trezor team is not that quick when it comes to Stellar compatibility)

@lauchaves
Copy link

lauchaves commented Jun 26, 2024

Hey 👋 @earrietadev Im still having issues testing it, I got the Trezor integration ready to test it... (I can open the PR in the meantime If you would like to go ahead and do some code review)

I tried with type: "module", es6 and even commonjs still no luck :c

I'm getting
image

I tried installing esm package as well didn't work either

@earrietadev
Copy link
Contributor Author

@lauchaves make sure your bundle is importing all the dependencies correctly. The kit works with Angular, React, Vue, Svelte and others.

If you're not sure if your bundle is correctly importing everything, you can create a blank React project with npx create-react-app my-app or a blank Angular app, they will import everything correctly

@lauchaves
Copy link

lauchaves commented Jun 26, 2024

@earrietadev got it 🚀 thanks! will test it now!

@lauchaves
Copy link

Hey @earrietadev, I just open a PR for this!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers ODHack
Projects
Status: Ready
Development

No branches or pull requests

5 participants
@lauchaves @earrietadev @ktarun1419 @NueloSE and others