Skip to content

function createPrivateKey missing #240

@ankushKun

Description

@ankushKun

I am working on a Lynx project and using their polyfills package which uses crypto-browserify for polyfilling the crypto package.

I am also using @permaweb/aoconnect package which relies on the createPrivateKey function from node:crypto, which seems to be missing from crypto-browserify, and results in the following error:

File: /Users/weeblet/Developer/ARWEAVE/FWD/subspace/mobileapp/node_modules/@permaweb/aoconnect/dist/index.js|react:main-thread:1:1
  × ESModulesLinkingError: export 'createPrivateKey' (imported as 'createPrivateKey') was not found in 'node:crypto' (possible exports: Cipher, Cipheriv, Decipher, Decipheriv, DiffieHellman, DiffieHellmanGroup, Hash, Hmac, Sign, Verify, constants, createCipher, createCipheriv, createCredentials, createDecipher, createDecipheriv, createDiffieHellman, createDiffieHellmanGroup, createECDH, createHash, createHmac, createSign, createVerify, getCiphers, getDiffieHellman, getHashes, listCiphers, pbkdf2, pbkdf2Sync, privateDecrypt, privateEncrypt, prng, pseudoRandomBytes, publicDecrypt, publicEncrypt, randomBytes, randomFill, randomFillSync, rng)
      ╭─[1876:23]
 1874 │ function createSigner(wallet) {
 1875 │     const publicKey = Buffer.from(wallet.n, "base64url");
 1876 │     const privateKey = createPrivateKey({
      ·                        ────────────────
 1877 │         key: wallet,
 1878 │         format: "jwk"
      ╰────

 @ ./src/App.tsx
 @ ./src/index.tsx

are there any plans for adding the missing function(s) to crypto-browserify?

Thanks

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions