Error: bad secret key size

I am learning https://dev.aepps.com/tutorials/naming-workflow-in-javascript-sdk.html

const client = await Universal({ url: ‘http://localhost:3013’,internalUrl: ‘http://localhost:3113’, keypair: { publicKey: publicKey, secretKey: ‘mypass’ }, networkId: ‘ae_mainnet’, nativeMode: true });

‘mypass’ is the password that generated my PUBLIC_KEY address, but I got:

UnhandledPromiseRejectionWarning: Error: bad secret key size

Something with my operations?

Hello, the secretKey needs to be the private key in hex format, as it would be generated using the CLI https://dev.aepps.com/tutorials/account-creation-in-ae-cli.html

1 Like

Also I just updated https://dev.aepps.com/tutorials/naming-workflow-in-javascript-sdk.html as the formatting was broken

2 Likes

Thank you very much~I’ll try later.

1 Like