[Solved] Easy development of JS-SDK?

Simple Usage: with tag,I finished creating mnemonics and generated public and private keys.

Now how do I call a method function to initiate a token transfer? And how should I sign?

1 Like

I plan to use JavaScript to complete it in the browser, and then send the signed Tx to the node broadcast.

1 Like

Are there related functions under the Ae variable? How should I use it? Or not yet? Can you help me?
@nduchak.chain @davidyuk

1 Like

Hey @LiuShao,
Please try this example:

<!doctype html>
<html lang="en">
  <meta charset="utf-8">
  <!-- include latest SDK version -->
  <script src="https://unpkg.com/@aeternity/aepp-sdk/dist/aepp-sdk.browser-script.js"></script>
  <script type="text/javascript">
    Ae.Node({ url: 'https://sdk-testnet.aepps.com' }).then(node => {
        const account = Ae.MemoryAccount({ keypair: { secretKey: 'YOUR_PRIV', publicKey: ' YOUR_PUB' } })
              nodes: [{ name: 'local', instance: node }],
              accounts: [ account ]
            }).then(aeInstance => {
              aeInstance.spend(RECIPIENT_PUB, 1e18).then(spendTx => { // Send 1 AE
                console.log("SPend TX:" + spendTx)

Thanks @nduchak.chain , I try.
Is there a way to encrypt it locally as Tx_ and then sign it? TX was broadcast last.
I see in Ae.Crypto, and Ae.sign seems to have this method?

Yes, please check this https://github.com/aeternity/aepp-sdk-js/blob/develop/docs/guides/low-vs-high-usage.md#low-level-sdk-usage-use-api-endpoints-directly

@LiuShao please let us know if your issue is resolved.

1 Like

Are there any plans to offer courses in China?

Hey @beijing

The Dacade 101 course on AE Development is translated into Chinese - see below:


We are now working on more advanced courses that will be translated as well.


No, I’m stupid. In the example, I run it to prompt AENS related errors. Not too clear where AENS is involved.

@LiuShao can you please share your code snippet, then i can fix it

Thank you @nduchak.chain ,
I was negligent. Now it works fine.
But I don’t seem to add the payload field.

Spend with payload: await client.spend(RECIPIENT, AMOUNT, { payload: 'Hello' })

Thanks @nduchak.chain , I have done it. Now there are new problems.

const KS = Ae.Keystore.dump('test','pwd',skey)

I did it like this, it seemed to succeed.
But when i

const priv =  Ae.Keystore.recover('pwd', KS)

It doesn’t seem to work.

What did you get(some Error)?
Provide please little bit more info, for me it’s works

Is my method wrong?

Am I importing the wrong format? I imported secretKey directly.

For example, I use the secretKey for testing

But when I am AE.Keystore.Recover ()


It doesn’t seem to be what I need. Does it need hex or how to deal with it?


Hey @xupei please stick to English. Thank you.