anchor
anchor copied to clipboard
TypeError: anchor.BN is not a constructor
Disclaimer: I am not very familiar with typescript, trying to learn while using anchor
I got the error from a stand alone mjs script I run. BN is needed to trigger a call to a back-end rust function. However, anchor.BN can be successfully constructed in a test scripts I used.
Some code snippet
import * as anchor from "@project-serum/anchor";
const price = new anchor.BN(1e6);
ask here: https://solana.stackexchange.com/