Error: bad secret key size


#1

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?


#2

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


#3

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


#4

Thank you very much~I’ll try later.