Describe the bug
I'm trying to do a native casper transfer with a wallet using the casper-js-sdk library directly from my frontend.
As specified in the documentation: https://docs.casper.network/developers/dapps/sdk/client-library-usage/
it would be necessary to initialize:
const keypair = Keys.Ed25519.loadKeyPairFromPrivateFile("./secret_key.pem");
However, I have this error which appears on my react: Uncaught (in promise) TypeError: f.readFileSync is not a function
at t.readBase64File (Keys.ts:348:1)
at t.parsePrivateKeyFile (Keys.ts:299:1)
Impossible to retrieve the value of keypair to subsequently call the line:
const signedDeploy = DeployUtil.signDeploy(deploy, keypair);
to validate my transaction.
To Reproduce
Identify if any Prequisites:
Steps to reproduce the behavior:
"react": "^18.2.0",
"react-scripts": "5.0.1",
"casper-js-sdk": "^2.15.2",
Expected behavior
Validate a native transaction from the front knowing that the user is connecting with their Casper wallet and therefore we do not have direct access to the private key
Describe the bug I'm trying to do a native casper transfer with a wallet using the casper-js-sdk library directly from my frontend. As specified in the documentation: https://docs.casper.network/developers/dapps/sdk/client-library-usage/ it would be necessary to initialize: const keypair = Keys.Ed25519.loadKeyPairFromPrivateFile("./secret_key.pem");
However, I have this error which appears on my react: Uncaught (in promise) TypeError: f.readFileSync is not a function at t.readBase64File (Keys.ts:348:1) at t.parsePrivateKeyFile (Keys.ts:299:1)
Impossible to retrieve the value of keypair to subsequently call the line: const signedDeploy = DeployUtil.signDeploy(deploy, keypair); to validate my transaction.
To Reproduce
Identify if any Prequisites:
Steps to reproduce the behavior:
Expected behavior Validate a native transaction from the front knowing that the user is connecting with their Casper wallet and therefore we do not have direct access to the private key
Screenshots![Screenshot 2023-09-13 at 18 27 26](https://github.com/casper-ecosystem/casper-js-sdk/assets/35635121/87648819-9afe-475a-8c84-21efca73f47c)
Thanks for your contribution