[Solved] Easy development of JS-SDK?

Ok, so first of all this
const KS = Ae.Keystore.dump('test','pwd',skey) return Promise and you need to wait until it resolves

Ae.Keystore.dump('test','pwd',skey).then(keystore => {
   Ae.Keystore.recover('pwd', KS).then(keypair => console.log(keypair))

Oh, No. …I run it like this,

Ae.Keystore.dump('LiuWallet','mima',secretKey).then(keystore => {
 Ae.Keystore.recover('mima', keystore).then(keypair => console.log(keypair))

I got it again.


This is not me.

Ae.Keystore.dump('LiuWallet','mima',secretKey).then(keystore => {
 Ae.Keystore.recover('mima', keystore)
    .then(keypair => console.log(Buffer.from(keypair, 'hex').toString())

Just convert it to hex
Also you can look into test cases: https://github.com/aeternity/aepp-sdk-js/blob/develop/test/unit/keystore.js#L55

This PR will resolve your problem: https://github.com/aeternity/aepp-sdk-js/pull/939.
After merge you should not need to do additional transformation
Thanks for feedback

My JavaScript foundation is poor. I can’t execute
Buffer.from(keypair, 'hex').toString()
in the browser.


OK,I’ve converted it, but it’s a bit of a hassle. Is there a simple way?eg. Encapsulated hex method.

    function hex2str(hex) {

please let us know if the issue is resolved ??

@LiuShao Hey,
Yes, this way introduced in this PR and already merged to develop.

Thank you @nduchak.chain . I’ve solved most of the problems


Thanks for the response..

1 Like

Hi @nduchak.chain


It reports an error in IE and works fine in chrome.