import { dirname } from "path" ; let secp256k1 ; try { const nodeRequire = eval ( "require" ) ; const path = nodeRequire . resolve ( "secp256k1/package.json" ) ; const dir = dirname ( path ) ; const nodeGypBuild = require ( "node-gyp-build" ) ; const { Secp256k1 } = nodeGypBuild ( dir ) ; secp256k1 = new Secp256k1 ( ) ; } catch { secp256k1 = require ( "secp256k1/lib/elliptic" ) ; } export default secp256k1 ;