rckprtr/pumpdotfun-sdk

Trying to use this but i'm getting NodeWallet not constructor

Closed this issue · 7 comments

const wallet = new NodeWallet(Keypair.generate()); //note this is not used

this errors with

const wallet = new NodeWallet(Keypair.generate()); //note this is not used
^
TypeError: NodeWallet is not a constructor

unsure what i'm doing wrong.

Dealing with same error

did you figure any solutions?

Can you show me the contents of nodewallet.d.ts ? Do you just clone the project and npm i it?

node -v
v20.10.0

Check the import also

import NodeWallet from "@coral-xyz/anchor/dist/cjs/nodewallet";

Capture

Yes followed all instructions, building custom script but running in to this issue.

Tried a workaround and ran into type error that Anchor_Wallet was missing.

for me, i didnt use commonjs within my tsconfig, that fixed it.

So the fix for the library might be using es2022 for the module and the target, which ill make the change

This is now resolved with Common JS in the build