Closed PomegranateApps closed 10 months ago
SecretKey is part of an older version of the crypto-utils library. You can install the proper version via the command:
npm install @cmdcode/crypto-utils@2.0.2
then import via:
import { SecretKey } from '@cmdcode/crypto-utils'
Ok thank you! I'm still getting "TypeError: SecretKey is not a constructor" even with 2.0.2.
Do you also have an updated code example with the latest version of your crypto npm?
Would love to see some updated code as well!
Ok thank you! I'm still getting "TypeError: SecretKey is not a constructor" even with 2.0.2.
runnin into this as well..
and then the previous util.getPublicKey()
function doesn't exist in crypto-utils
either.
In the latest version of @cmdcode/crypto-utils
:
import * as ecc from '@cmdcode/crypto-utils'
const seckey = ecc.keys.gen_seckey()
Everything is typed so you should be able to explore the API for ecc
and ecc.keys
using vscode or any code editor that supports completions with typescript.
I am still working on updating the documentation for @cmdcode/crypto-utils
and @cmdcode/tapscript
in my free time. I apologize for the delay! Let me know if you have any further questions on this.
How do you import the SecretKey constructor?
It's used in the examples.