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

ts: Export wallet type #1122

Closed
wants to merge 2 commits into from
Closed

Conversation

vpontis
Copy link
Contributor

@vpontis vpontis commented Dec 10, 2021

This allows us to use the Wallet type since we are now exporting it from index.ts.

@acamill
Copy link
Contributor

acamill commented Dec 10, 2021

Wasn't that a deliberate change? I've refactored to using Publickey/Signer

@vpontis
Copy link
Contributor Author

vpontis commented Dec 11, 2021

Wasn't that a deliberate change? I've refactored to using Publickey/Signer

If you want to do something like Mint an NFT, you need to create a Provider for functions like Program.fetchIdl or to create a new Program instance.

The Provider object requires a Wallet, not just a Signer since it calls wallet.signTransaction.

@vpontis
Copy link
Contributor Author

vpontis commented Dec 11, 2021

Also @armaniferrante I would consider removing the Prettier test requirement. It's the kind of requirement that seems nice in theory but in practice just leads to a lot of test failures and annoyance.

For example, right now I've run yarn lint:fix locally but for some reason that isn't lining up w/ whatever is running in GitHub actions.

default as Provider,
getProvider,
setProvider,
Wallet,
Copy link
Contributor

Choose a reason for hiding this comment

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

Wouldn't this conflict with the conditional export down below? Wallet is an interface while Node wallet is a class, but they're exported via the same namespace.

@armaniferrante
Copy link
Member

For example, right now I've run yarn lint:fix locally but for some reason that isn't lining up w/ whatever is running in GitHub actions.

Thanks for the feedback. If this continues to be a problem we can remove it, though this is the first instance of this occuring. Otherwise, I prefer to keep it to help keep cosmetic comments in PRs to a minimum.

Can you give me write access to the branch so that I can push the lint changes?

@vpontis
Copy link
Contributor Author

vpontis commented Dec 13, 2021

@armaniferrante added you to our repo :)

Yea it's weird. I'm not sure why prettier isn't working for me...

Re the Wallet type — there is a PR in solana-labs/wallet-adapter that is creating a new Wallet type. It might be nice to coordinate the idea / type of wallet / adapter across anchor and the wallet-adapter package.

@Findiglay
Copy link

Interestingly, @solana/wallet-adapter-react exports a useAnchorWallet hook, but its type is incompatible with anchor Provider class.

@jordaaash
Copy link

Interestingly, @solana/wallet-adapter-react exports a useAnchorWallet hook, but its type is incompatible with anchor Provider class.

We should probably fix that! Want to create an issue or PR on WalletAdapter?

@Findiglay
Copy link

@jordansexton yeah, will open an issue there 👍

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.

6 participants