anchor icon indicating copy to clipboard operation
anchor copied to clipboard

TypeError: anchor.BN is not a constructor

Open bdai opened this issue 3 years ago • 1 comments

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);

bdai avatar Sep 14 '22 15:09 bdai

ask here: https://solana.stackexchange.com/

Gajesh2007 avatar Sep 14 '22 22:09 Gajesh2007