libitx / txforge

Modern Bitcoin transaction builder, capable of supporting any non-standard and custom script type.
Apache License 2.0
63 stars 21 forks source link

P2PKH.js - ReferenceError: casts is not defined (Unable to find module within Nimble) #22

Closed jsim77 closed 2 years ago

jsim77 commented 2 years ago

Dear Community,

Sorry is me again. I'm referring to - nimble/classes/p2pkh.js

Have solved the first "import" issue that is to replace with - const { forgeTx } =require('txforge') and in the package.json, I've added "module":"true"

Right now, the next line problem is the:

const { P2PKH, OpReturn } =casts ^

ReferenceError: casts is not defined

I did add the word "require" --> const { P2PKH, OpReturn } =require('casts') then the new error is:

node:internal/modules/cjs/loader:936 throw err; ^ Error: Cannot find module 'casts' Require stack:

Question - how to search for "casts" module within nimble?

Kindly refer to the screenshot for your easy reference, thanks.

Screenshot 2022-08-12 at 8 42 59 PM Screenshot 2022-08-12 at 8 44 57 PM
jsim77 commented 2 years ago

Using Const.