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: fix Wallet class declaration #1363

Merged
merged 3 commits into from Jan 31, 2022
Merged

ts: fix Wallet class declaration #1363

merged 3 commits into from Jan 31, 2022

Conversation

callensm
Copy link
Member

Previously, the Wallet type declaration at the package root was declared as a const of type NodeWallet. This doesn't work and causes typing issues since now Wallet is a variable and not an instantiable class.

I changed the declaration so that Wallet is now a "new class" that extends the functionality of NodeWallet allowing it to maintain its class identify and instantiability.

ts/src/index.ts Outdated Show resolved Hide resolved
@devanshsanghvi
Copy link

devanshsanghvi commented Jan 31, 2022

Hello, is that pushed to the latest npm package ? I am trying to use it but getting errors -

`import {Wallet} from "@project-serum/anchor";

const wallet = new Wallet(USER_KEYPAIR);
`

throws this error: Type 'NodeWallet' has no construct signatures.

@callensm
Copy link
Member Author

@devanshsanghvi this hasn't been merged into master or cut into a version package version yet so the changes are not available.

@armaniferrante armaniferrante merged commit 714f5e6 into coral-xyz:master Jan 31, 2022
losman0s pushed a commit to losman0s/anchor that referenced this pull request Feb 7, 2022
archseer added a commit to smartcontractkit/chainlink-solana that referenced this pull request Feb 11, 2022
archseer added a commit to smartcontractkit/chainlink-solana that referenced this pull request Feb 11, 2022
archseer added a commit to smartcontractkit/chainlink-solana that referenced this pull request Feb 11, 2022
archseer added a commit to smartcontractkit/chainlink-solana that referenced this pull request Feb 14, 2022
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.

None yet

3 participants