Skip to content

ts: fix Wallet class declaration#1363

Merged
armaniferrante merged 3 commits into
otter-sec:masterfrom
callensm:master
Jan 31, 2022
Merged

ts: fix Wallet class declaration#1363
armaniferrante merged 3 commits into
otter-sec:masterfrom
callensm:master

Conversation

@callensm

Copy link
Copy Markdown
Contributor

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.

Comment thread ts/src/index.ts Outdated
@devanshsanghvi

devanshsanghvi commented Jan 31, 2022

Copy link
Copy Markdown

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
Copy Markdown
Contributor 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 otter-sec: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
jdiaz879 added a commit to jdiaz879/chainlink-solana that referenced this pull request Sep 14, 2025
Otter-0x4ka5h pushed a commit to Otter-0x4ka5h/anchor that referenced this pull request Mar 25, 2026
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.

3 participants